Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 1F0EA4753A1 for ; Wed, 20 Nov 2002 21:40:50 -0500 (EST) Received: from new-smtp2.ihug.com.au (new-smtp2.ihug.com.au [203.109.250.28]) by postgresql.org (Postfix) with ESMTP id 13DF8474E53 for ; Wed, 20 Nov 2002 21:40:47 -0500 (EST) Received: from p261-tnt2.mel.ihug.com.au (postgresql.org) [203.173.165.7] by new-smtp2.ihug.com.au with esmtp (Exim 3.22 #1 (Debian)) id 18EhGq-0008Ba-00; Thu, 21 Nov 2002 13:40:48 +1100 Message-ID: <3DDC47A9.4C0BC2DE@postgresql.org> Date: Thu, 21 Nov 2002 13:40:41 +1100 From: Justin Clift X-Mailer: Mozilla 4.8 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: Oliver Elphick Cc: Robert Treat , pgsql-hackers@postgresql.org Subject: Re: [GENERAL] Bug with sequence References: <92c0776e.0211180745.49911131@posting.google.com> <1037782392.29678.88.camel@linda> <1037828113.23925.101.camel@camel> <1037830378.24840.40.camel@linda> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/835 X-Sequence-Number: 32051 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. This sounds like a serious bug in our behaviour, and not something we'd like to release. Specifically in relation to people's existing scripts, and also to people who are doing dump/restore of specific tables (it'll kill the sequences that other tables depend on too!) No real issue with the nicety for newbies, but am very concerned about the lack of a dependancy check here. :-/ Regards and best wishes, Justin Clift > 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? > > -- > Oliver Elphick Oliver.Elphick@lfix.co.uk > Isle of Wight, UK > http://www.lfix.co.uk/oliver > GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C > ======================================== > "If my people, which are called by my name, shall > humble themselves, and pray, and seek my face, and > turn from their wicked ways; then will I hear from > heaven, and will forgive their sin, and will heal > their land." II Chronicles 7:14 > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly -- "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