Re: [GENERAL] Bug with sequence

Justin Clift <justin@postgresql.org>

From: Justin Clift <justin@postgresql.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Oliver Elphick <olly@lfix.co.uk>, Robert Treat <xzilla@users.sourceforge.net>, pgsql-hackers@postgresql.org
Date: 2002-11-21T05:03:18Z
Lists: pgsql-hackers, pgsql-general
Tom Lane wrote:
> 
> Justin Clift <justin@postgresql.org> writes:
> > Oliver Elphick wrote:
> >> I created a sequence using SERIAL when I created a table.  I used the
> >> same sequence for another table by setting a column default to
> >> nextval(sequence).
> >>
> >> I deleted the first table.  The sequence was deleted too, leaving the
> >> default of the second table referring to a non-existent sequence.
> 
> > This sounds like a serious bug in our behaviour, and not something we'd
> > like to release.
> 
> We will be releasing it whether we like it or not, because
> nextval('foo') doesn't expose any visible dependency on sequence foo.

Awww rats.

<snip>
> 7.3 breaks no existing schemas, because older schemas will be dumped
> as separate CREATE SEQUENCE and CREATE TABLE ... DEFAULT nextval()
> commands.

Ok.

Thanks Tom.  :)

Regards and best wishes,

Justin Clift

>                         regards, tom lane

-- 
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
   - Indira Gandhi