Re: [WIP] ALTER ... OWNER TO ... CASCADE - Mailing list pgsql-hackers

From Dmitry Ivanov
Subject Re: [WIP] ALTER ... OWNER TO ... CASCADE
Date
Msg-id 1786400.HAYzWAAglf@abook
Whole thread Raw
In response to Re: [WIP] ALTER ... OWNER TO ... CASCADE  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> Dmitry Ivanov <d.ivanov@postgrespro.ru> writes:
> > As of now there's no way to transfer the ownership of an object and all
> > its
> > dependent objects in one step. One has to manually alter the owner of each
> > object, be it a table, a schema or something else.
> 
> TBH, this sounds like a completely terrible idea.  There are far too many
> sorts of dependencies across which one would not expect ownership to
> propagate; for example, use of a function in a view, or even just a
> foreign key dependency between two tables.

Well, actually this is a statement of the fact, and I don't propose enabling 
this option for every dependency possible. This patch includes an experimental 
feature that anyone can try and discuss, nothing more. Besides, it acts a lot 
like 'drop ... cascade' (the findDependentObjects() function is used under the 
hood), so the behavior is totally predictable. It also writes down all objects 
that have been touched, so no change goes unnoticed.

> I'm not even clear that there are *any* cases where this behavior is
> wanted, other than perhaps ALTER OWNER on an extension

At very least this might be useful in order to change owner of all tables 
which inherit some table.

-- 
Dmitry Ivanov
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company



pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: GetExistingLocalJoinPath() vs. the docs
Next
From: Teodor Sigaev
Date:
Subject: Re: [WIP] ALTER ... OWNER TO ... CASCADE