This is a migrated thread and some comments may be shown as answers.

Postgresql sequence

4 Answers 68 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
LordRevan007
Top achievements
Rank 1
LordRevan007 asked on 20 Jun 2011, 04:41 PM
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

4 Answers, 1 is accepted

Sort by
0
Thomas
Telerik team
answered on 21 Jun 2011, 08:52 AM
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. 
0
LordRevan007
Top achievements
Rank 1
answered on 21 Jun 2011, 12:58 PM
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.
0
Thomas
Telerik team
answered on 21 Jun 2011, 03:27 PM
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. 
0
LordRevan007
Top achievements
Rank 1
answered on 21 Jun 2011, 04:08 PM
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
Tags
Data Access Free Edition
Asked by
LordRevan007
Top achievements
Rank 1
Answers by
Thomas
Telerik team
LordRevan007
Top achievements
Rank 1
Share this question
or