Re: Sequence increased before constraint check

Peter Eisentraut <peter_e@gmx.net>

From: Peter Eisentraut <peter_e@gmx.net>
To: <davidl@ayamba.com>, <pgsql-bugs@postgresql.org>
Date: 2001-02-14T18:46:43Z
Lists: pgsql-bugs
> When a table is created with a serial column and another column that
> has a foreign key constraint, if the foreign key check fails, the
> sequence will still be updated.  This results in potential gaps in the
> serial column.

This is not a bug.  If you cannot have gaps in your number sequence then
you cannot use serial.

-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/