Re: [WIP] ALTER ... OWNER TO ... CASCADE

From: Dmitry Ivanov <d(dot)ivanov(at)postgrespro(dot)ru>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [WIP] ALTER ... OWNER TO ... CASCADE
Date: 2016-02-15 15:44:54
Message-ID: 1786400.HAYzWAAglf@abook
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Dmitry Ivanov <d(dot)ivanov(at)postgrespro(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Teodor Sigaev 2016-02-15 15:56:03 Re: [WIP] ALTER ... OWNER TO ... CASCADE
Previous Message Stephen Frost 2016-02-15 15:41:03 GetExistingLocalJoinPath() vs. the docs