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

Re: ALTER TABLE ... OWNER TO does not change ownership recursively

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ryan Kelly <rpkelly22(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: ALTER TABLE ... OWNER TO does not change ownership recursively
Date: 2012-04-26 23:04:30
Message-ID: 16643.1335481470@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
Ryan Kelly <rpkelly22(at)gmail(dot)com> writes:
> It seems that ALTER TABLE ... OWNER TO does not change the ownership of
> any inheriting tables. The documentation states:

>> If ONLY is specified, only that table is altered. If ONLY is not
>> specified, the table and any descendant tables are altered.

If you read further (down in the Notes section of the ALTER TABLE page),
you'll find

	The TRIGGER, CLUSTER, OWNER, and TABLESPACE actions never
	recurse to descendant tables; that is, they always act as though
	ONLY were specified.

So it is operating as intended and documented.  If we were starting
from a green field I'd question whether these exceptions were a good
idea, but at this point changing the behavior seems more likely to break
user code than to help people.  (In particular, the possible
consequences for reloading old dump files seem a bit scary, since
pg_dump emits lots of ALTER OWNER commands.)

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Josh BerkusDate: 2012-04-26 23:54:56
Subject: Re: 291 pg_toast_temp schemas?
Previous:From: Jaime CasanovaDate: 2012-04-26 22:52:46
Subject: Re: 291 pg_toast_temp schemas?

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