On 24/02/11 21:09, Jacques Lebrun wrote:
I guess when I do an insert with all the fields (including the RowId),
Postgres does not increment the serial counter.
I cannot remove the RowId field from the Insert of my setup script
because this setup script is also used by customers using MySQL.

Apart from Vibhor's suggestion (which is the typical way PG does it) you can also set the auto field to DEFAULT:

INSERT INTO mytable (rowid, other) VALUES (DEFAULT,'a'), (DEFAULT,'b');

This should work on either system.

--
  Richard Huxton
  Archonet Ltd

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

Reply via email to