Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group