Page 1 of 1

[Solved] Auto-Increment on PrimaryKey with Postgresql

Posted: Mon Apr 04, 2011 10:44 pm
by automas
I have created a form in OpenOffice.org.Base 3.1.0 in connection with a table in a Postgresql-Database.
This table includes a column named "id" which is the Primary Key (Data type "numeric"). The default value is "nextval('id_seq'::regclass)". "id_seq" is a Sequenze.
Now it's possible to add a new value with auto-increment using the postgresql Admin-Tool.
But if I wan't to add a new value using my form in Base the system shows an alert describing, that there's a failure with the ResultSet and I have to call "next".
Whats wrong?

Re: Auto-Increment on PrimaryKey with Postgresql

Posted: Wed Aug 10, 2011 11:06 am
by automas
In the meantime I solved the problem.
Obviously the Data type of the Primary Key should be "serial" or "bigserial". If you do so the value of "Default value" is automatically written (For example: "nextval('"Table1_id_seq"'::regclass)").