pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rod Taylor <rbt@rbt.ca>
To: Oliver Elphick <olly@lfix.co.uk>
Cc: Robert Treat <xzilla@users.sourceforge.net>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: [GENERAL] Bug with sequence
Date: 20 Nov 2002 18:20:38 -0500
Message-ID: <1037834437.38320.4.camel@jester> (raw)
In-Reply-To: <1037830378.24840.40.camel@linda>
References: <92c0776e.0211180745.49911131@posting.google.com>
	<1037782392.29678.88.camel@linda>
	<1037828113.23925.101.camel@camel>
	<1037830378.24840.40.camel@linda>

This requires changing the nextval() function to be an attribute of the
sequence.

ie.  sequence.nextval and sequence.currval to deal with the sequence.


It should also be on the todo list.

On Wed, 2002-11-20 at 17:12, Oliver Elphick wrote:
> On Wed, 2002-11-20 at 21:35, Robert Treat wrote:
> > On Wed, 2002-11-20 at 03:53, Oliver Elphick wrote:
> > > On Mon, 2002-11-18 at 15:45, Thomas Aichinger wrote:
> > > > Hi,
> > > > 
> > > > I recently installed pg 7.2.3 on my linux box and discovered that
> > > > there are some problems with datatype serial and sequence.
> > > > 
> > > > 1.) If you create a table with a datatype serial, the corrsponding
> > > > sequence will be created, but if you drop the table the sequence is
> > > > not dropped.
> > > 
> > > This is fixed in 7.3
> > > 
> > 
> > out of curiosity, do you know the logic that implements this fix? I have
> > a couple of tables that use the same sequence; I'm wondering if dropping
> > one of the tables removes the sequence or if I have to drop all tables
> > before the sequence is removed
> 
> I just tried it.
> 
> 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.
> 
> 
> Could this be a TODO item in 7.4, to add a dependency check when a
> sequence is set as the default without being created at the same time?
-- 
Rod Taylor <rbt@rbt.ca>




view thread (19+ messages)  latest in thread

Message-ID: <1037834437.38320.4.camel@jester>
Permalink:  ../1037834437.38320.4.camel@jester/
Also on:    postgresql.org/message-id/1037834437.38320.4.camel@jester

 · 

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: rbt@rbt.ca, olly@lfix.co.uk, xzilla@users.sourceforge.net, pgsql-hackers@postgresql.org
  Subject: Re: [GENERAL] Bug with sequence
  In-Reply-To: <1037834437.38320.4.camel@jester>

* 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