pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas O'Connell <tfo@monsterlabs.com>
Cc: pgsql-hackers@postgresql.org
Cc: pgsql-sql@postgresql.org
Subject: Re: [HACKERS] [GENERAL] Bug with sequence
Date: Thu, 21 Nov 2002 14:30:14 -0500
Message-ID: <13787.1037907014@sss.pgh.pa.us> (raw)
In-Reply-To: <tfo-99ACEC.12534521112002@news.hub.org>
References: <7017.1037851915@sss.pgh.pa.us>
	<tfo-99ACEC.12534521112002@news.hub.org>

"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



view thread (19+ messages)  latest in thread

Message-ID: <13787.1037907014@sss.pgh.pa.us>
Permalink:  ../13787.1037907014@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/13787.1037907014@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, tfo@monsterlabs.com, pgsql-hackers@postgresql.org
  Subject: Re: [HACKERS] [GENERAL] Bug with sequence
  In-Reply-To: <13787.1037907014@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox