pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ryan Kelly <rpkelly22@gmail.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: ALTER TABLE ... OWNER TO does not change ownership recursively
Date: Thu, 26 Apr 2012 19:04:30 -0400
Message-ID: <16643.1335481470@sss.pgh.pa.us> (raw)
In-Reply-To: <20120426114232.GA31886@llserver.lakeliving.com>
References: <20120426114232.GA31886@llserver.lakeliving.com>

Ryan Kelly <rpkelly22@gmail.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



view thread (2+ messages)

Message-ID: <16643.1335481470@sss.pgh.pa.us>
Permalink:  ../16643.1335481470@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/16643.1335481470@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, rpkelly22@gmail.com
  Subject: Re: ALTER TABLE ... OWNER TO does not change ownership recursively
  In-Reply-To: <16643.1335481470@sss.pgh.pa.us>
  References: <20120426114232.GA31886@llserver.lakeliving.com> <16643.1335481470@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox