Re: [HACKERS] [GENERAL] Bug with sequence

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: "Thomas O'Connell" <tfo@monsterlabs.com>
Cc: pgsql-hackers@postgresql.org, pgsql-sql@postgresql.org
Date: 2002-11-21T19:30:14Z
Lists: pgsql-hackers, pgsql-general
"Thomas O'Connell" <tfo@monsterlabs.com> writes:
> It seems worth pointing out, too, that some SQL purists propose not 
> relying on product-specific methods of auto-incrementing.
> I.e., it is possible to do something like:
> insert into foo( col, ... )
> values( coalesce( ( select max( col ) from foo ), 0 ) + 1, ... );
> and this is easily placed in a trigger.

... but that approach is entirely unworkable if you want any concurrency
of insert operations.  (Triggers are a tad product-specific, too :-()

			regards, tom lane