Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 48450476583 for ; Tue, 26 Nov 2002 10:31:31 -0500 (EST) Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id 88BAB47681D for ; Tue, 26 Nov 2002 10:30:37 -0500 (EST) Received: by news.hub.org (Postfix, from userid 8) id B284243A646; Tue, 26 Nov 2002 10:30:36 -0500 (EST) From: pgulutzan@ocelot.ca (Peter Gulutzan) X-Newsgroups: comp.databases.postgresql.hackers Subject: Re: [GENERAL] Bug with sequence Date: 26 Nov 2002 07:30:12 -0800 Organization: http://groups.google.com/ Lines: 37 Message-ID: <36c478c6.0211260730.a45279d@posting.google.com> References: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: groups-abuse@google.com To: pgsql-hackers@postgresql.org X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/979 X-Sequence-Number: 32195 scott.marlowe@ihs.com ("scott.marlowe") wrote in message news:... > On 21 Nov 2002, Rod Taylor wrote: > > > On Thu, 2002-11-21 at 15:09, scott.marlowe wrote: > > > On 21 Nov 2002, Rod Taylor wrote: > > > > > > > On Thu, 2002-11-21 at 14:11, Bruce Momjian wrote: > > > > > Of course, those would be SQL purists who _don't_ understand > > > > > concurrency issues. ;-) > > > > > > > > Or they're the kind that locks the entire table for any given insert. > > > > > > Isn't that what Bruce just said? ;^) > > > > I suppose so. I took what Bruce said to be that multiple users could > > get the same ID. > > > > I keep having developers want to make their own table for a sequence, > > then use id = id + 1 -- so they hold a lock on it for the duration of > > the transaction. > > I was just funnin' with ya, but the point behind it was that either way > (with or without a lock) that using something other than a sequence is > probably a bad idea. Either way, under parallel load, you have data > consistency issues, or you have poor performance issues. > > I'm not familiar with these "SQL purists" (perhaps the reference is to J. Celko?) but the fact is that it's hard to call SEQUENCE product-specific now that it's in Oracle, DB2, and SQL:2003. The syntaxes do differ a little, usually due to choice of abbreviation, but as far as I can tell the internals are similar across implementations. Peter Gulutzan Author of "Sequences And Identity Columns" (http://dbazine.com/gulutzan4.html)