Unable to create serial column even with permissions

From: Josh Berkus <josh(dot)berkus(at)pgexperts(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Unable to create serial column even with permissions
Date: 2010-08-10 04:07:46
Message-ID: 4C60D092.8060301@pgexperts.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)berkus(at)pgexperts(dot)com www.pgexperts.com
1-888-743-9778 x.508 San Francisco

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2010-08-10 04:11:36 Re: BUG #5603: pg_tblspc and pg_twoface directories get deleted when starting up service
Previous Message Tom Lane 2010-08-10 03:16:28 Re: BUG #5608: array_agg() consumes too much memory