Quoting - <grandebu...@gmail.com>:
I know you can skip SEQUENCE - ((SELECT nextval ('seq_table')) do not put this in the query, my question was that such concurrency, and ids omitted which can not be inserted but increased with SEQUENCE ?
In the initial message you have been wondering, if you should be worried about "wasted" sequence tokens. You have mentioned, that your primary key is of type int8 and so is the sequence range. Do you really expect as many records and/or insert queries? If so, consider the id column int8 DEFAULT NULL and an AFTER INSERT trigger function that would take a nextval of the sequence and update the id accordingly once the record *has been actually inserted* instead of poking the sequence each time you *are going to insert* something. I am pretty sure, that the table is locked to prevent inserts until the after-insert-trigger is finished. Cheers, -Mike -- MichaĆ Roszka m...@if-then-else.pl -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql