Re: [GENERAL] Bug with sequence

From: pgulutzan(at)ocelot(dot)ca (Peter Gulutzan)
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [GENERAL] Bug with sequence
Date: 2002-11-26 15:30:12
Message-ID: 36c478c6.0211260730.a45279d@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-sql

scott(dot)marlowe(at)ihs(dot)com ("scott.marlowe") wrote in message news:<Pine(dot)LNX(dot)4(dot)33(dot)0211211450100(dot)23804-100000(at)css120(dot)ihs(dot)com>...
> 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)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Henshall, Stuart - Design & Print 2002-11-26 15:46:42 Re: Updating record drops it to the bottom
Previous Message Doug McNaught 2002-11-26 15:19:22 Re: Updating record drops it to the bottom

Browse pgsql-hackers by date

  From Date Subject
Next Message Curtis Faith 2002-11-26 15:32:28 [HACKERS] Realtime VACUUM, was: performance of insert/delete/update
Previous Message David Wheeler 2002-11-26 15:18:22 Re: 7.3rc2 Test Failures

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Huxton 2002-11-26 15:35:02 Re: How does postgres handle non literal string values
Previous Message Richard Huxton 2002-11-26 15:26:37 Re: help on sql query