Postgresql sequence

5 posts, 0 answers
  1. LordRevan007
    LordRevan007 avatar
    20 posts
    Member since:
    May 2011

    Posted 20 Jun 2011 Link to this post

    Hello there, I am having a hard time with OA and Postgresql. It seems that I doesn't see any sequence when I am creating a table based on inheritance. For example:
    I am having the table:

    CREATE TABLE audit."Updates" (
      "idUser" INTEGER NOT NULL,
      "updateTime" DATE DEFAULT now() NOT NULL,
      "idUpdateType" INTEGER NOT NULL
    ) WITHOUT OIDS;

    Which serves as a base table for my auditing tables.  Then I have a table from another schema, which hold the data that I am showing to the end user.

    CREATE TABLE public."Class" (
      "idClass" SERIAL,
      "name" VARCHAR(150), 
      CONSTRAINT "Clas_pkey" PRIMARY KEY("idClass")
    ) WITHOUT OIDS;

    As you can see there are two tables on different schema. Now I create the table:

    CREATE TABLE audit."ClassUpdates" (
      "ID" SERIAL,
      CONSTRAINT "ClassUpdates_pkey" PRIMARY KEY("ID")
    ) INHERITS (audit."Updates", public."Curs")
    WITHOUT OIDS;

    So far no problem, add the tables Class and ClassUpdates in the same diagram to be mapped in and also to use the same context. It passes the validation and the classes are generated. Next I try to add some records in Class table, with no problems, but when I try to add the update made to the class table in my ClassUpdates table it shows me an error that the sequence created in ClassUpdate isn't seen by OA.

    Where it is the problem?

    Thanks in advance,
    Lord Revan 007
  2. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 21 Jun 2011 Link to this post

    Hi LordRevan007,

    we have identified and fixed an issue that occured, when the sequence was generated in a non-default (not public)  schema; then the sequence was not properly detected.
    You can manually set the sequence field to be calculated by the backend, or use the upcoming Q2 2011 release that will have the needed changes.

    Best wishes,
    Thomas
    the Telerik team
    Want to use Telerik OpenAccess with SQL Azure? Download the trial version today. 
  3. DevCraft banner
  4. LordRevan007
    LordRevan007 avatar
    20 posts
    Member since:
    May 2011

    Posted 21 Jun 2011 Link to this post

    Thanks for the fast answer. I tried the solution proposed here, but with no success. When I add a new record to the ClassUpdates it says, that it doesn't find my sequence, I also tried lowercasing the sequence but still with no success. I think I will try to create another diagram, for that schema and see the output. If no success, than I will think to other solutions.
  5. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 21 Jun 2011 Link to this post

    Hello LordRevan007,

    seems like you will need to use the Q2 2011 release that is to be released in 3 weeks.

    Best wishes,
    Thomas
    the Telerik team
    Want to use Telerik OpenAccess with SQL Azure? Download the trial version today. 
  6. LordRevan007
    LordRevan007 avatar
    20 posts
    Member since:
    May 2011

    Posted 21 Jun 2011 Link to this post

    After all the struggling, I finally solved it. The problem was with the fact that I used multiple inheritance and the fact that I was using a different schema. When I change those things it worked pretty good. Hopefully, the next release will fix these problems.

    LordRevan007
Back to Top
DevCraft banner