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

From Tom Lane
Subject Re: [WIP] ALTER ... OWNER TO ... CASCADE
Date
Msg-id 16566.1455548124@sss.pgh.pa.us
Whole thread Raw
In response to [WIP] ALTER ... OWNER TO ... CASCADE  (Dmitry Ivanov <d.ivanov@postgrespro.ru>)
Responses Re: [WIP] ALTER ... OWNER TO ... CASCADE
Re: [WIP] ALTER ... OWNER TO ... CASCADE
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.

I'm not even clear that there are *any* cases where this behavior is
wanted, other than perhaps ALTER OWNER on an extension --- and even there,
what you would want is altering the ownership of the member objects, but
not everything that depends on the member objects.

So basically, a generic CASCADE facility sounds like a lot of work to
produce something that would seldom be anything but a foot-gun.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Small PATCH: check of 2 Perl modules
Next
From: Tom Lane
Date:
Subject: Re: Small PATCH: check of 2 Perl modules