Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 8644E475D22 for ; Mon, 18 Nov 2002 20:22:24 -0500 (EST) Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id 294EA475BC3 for ; Mon, 18 Nov 2002 20:22:24 -0500 (EST) Received: by news.hub.org (Postfix, from userid 8) id 18B7D43A564; Mon, 18 Nov 2002 20:22:24 -0500 (EST) From: Lee Harr X-Newsgroups: comp.databases.postgresql.questions Subject: Re: Bug with sequence Date: Tue, 19 Nov 2002 01:22:24 +0000 (UTC) Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 43 Message-ID: References: <92c0776e.0211180745.49911131@posting.google.com> Reply-To: missive@hotmail.com X-Complaints-To: usenet@news.hub.org User-Agent: slrn/0.9.7.3 (FreeBSD) To: pgsql-general@postgresql.org X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/779 X-Sequence-Number: 33200 In article <92c0776e.0211180745.49911131@posting.google.com>, 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. > I am pretty sure this has been fixed in version 7.3 (due to be release real soon now.) > 2.) If you create a sequence and grant it to public one cant use > currval() until one used setval() or nextval(). > "ERROR: midnr.currval is not yet defined in this session" > This is actually the way sequences work (ie, it's a feature, not a bug, heh heh) currval() gives you the current value of the sequence *as seen in this session* ... so until you do a setval() or a nextval() there is no value seen by this session. > 3.) Sometimes one gets 'not enogh privileges' error when using > nexval() > nextval()? hmm. well. If the user does not have privelege to update the sequence, then the call will fail. > > Am I the first one who discovered that? > Nah, and probably not the first one to avoid the FAQ either. heh heh.