Unable to create serial column even with permissions - Mailing list pgsql-bugs

From Josh Berkus
Subject Unable to create serial column even with permissions
Date
Msg-id 4C60D092.8060301@pgexperts.com
Whole thread Raw
Responses Re: Unable to create serial column even with permissions
List pgsql-bugs
Severity: Minor
Version tested: 8.4.4
Platform: Solaris 10u8
Steps to reproduce:

1. Create table "sometable" owned by user "someuser", and fill it with a
million generate_series records.

2. Log in as the superuser "postgres".

3. Do:

alter table sometable add column someserial serial;

4. Postgres attempts to add and populate the serial column for this
table.  This takes a while.

5. At the very end, after waiting for creation and population and
locking the table for a while, you get:

ERROR:  sequence must have same owner as table it is linked to

What should happen instead:

If the creating user has permissions on the table sufficient to create a
column on the table, the sequence should be created as owned by the
table owner.

At the very least, postgres should throw an error before spending a lot
of time populating the serial column ( "Only the table owner can create
a serial column" ).

--
-- Josh Berkus
---------------------------------------------------------
Josh Berkus                       PostgreSQL Experts Inc.
CEO                               database professionals
josh.berkus@pgexperts.com         www.pgexperts.com
1-888-743-9778 x.508              San Francisco

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #5608: array_agg() consumes too much memory
Next
From: Tom Lane
Date:
Subject: Re: BUG #5603: pg_tblspc and pg_twoface directories get deleted when starting up service