Re: PostgreSQL 7.1 and Sequences - Mailing list pgsql-general

From Tom Lane
Subject Re: PostgreSQL 7.1 and Sequences
Date
Msg-id 27858.987955682@sss.pgh.pa.us
Whole thread Raw
In response to PostgreSQL 7.1 and Sequences  ("Alastair D'Silva" <deece@newmillennium.net.au>)
List pgsql-general
"Alastair D'Silva" <deece@newmillennium.net.au> writes:
> I've recently upgraded to 7.1 and have the following situation which no
> longer works:
> As user "nmnadmin":
> CREATE TABLE blah {
>         id NOT NULL SERIAL,
>         info text NOT NULL
> };
> GRANT SELECT, INSERT, UPDATE, DELETE ON blah TO nmnuser;
> As user "nmnuser":
> INSERT INTO blah (info) VALUES ('foo');
> I get the following error:
> blah_id_seq.nextval: you don't have permissions to set sequence blah_id_seq

You should also do
    GRANT UPDATE ON blah_id_seq TO nmnuser;

I am not sure whether to regard the change from 7.0 behavior as a bug or
not.  The old handling of permission-checking for sequences was pretty
broken, and I don't want to revert to it.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: last comma inside "CREATE TABLE ()" statements
Next
From: "David Wall"
Date:
Subject: Re: Re: Getting milliseconds out of TIMESTAMP