Re: Bug with sequence

From: Lee Harr <missive(at)frontiernet(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Bug with sequence
Date: 2002-11-19 01:22:24
Message-ID: arc3of$1c2a$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-sql

In article <92c0776e(dot)0211180745(dot)49911131(at)posting(dot)google(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message * Tong * 2002-11-19 01:29:48 Re: Authorise root as postgres
Previous Message Brian Minton 2002-11-19 00:51:11 Re: signed/unsigned integers

Browse pgsql-hackers by date

  From Date Subject
Next Message Adrian Calvin 2002-11-19 03:02:40 Question regarding effects of Vacuum, Vacuum Analyze, and Reindex
Previous Message Tatsuo Ishii 2002-11-19 01:21:30 Re: Ideas needed: How to create and store collation

Browse pgsql-sql by date

  From Date Subject
Next Message Hugh Esco 2002-11-19 04:44:20 Re: Problems invoking psql. Help please.
Previous Message Robert Treat 2002-11-18 18:05:39 Re: Press Release -- Just Waiting for Tom