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

Поиск
Список
Период
Сортировка
От Dmitry Ivanov
Тема Re: [WIP] ALTER ... OWNER TO ... CASCADE
Дата
Msg-id 1786400.HAYzWAAglf@abook
обсуждение исходный текст
Ответ на Re: [WIP] ALTER ... OWNER TO ... CASCADE  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Stephen Frost
Дата:
Сообщение: GetExistingLocalJoinPath() vs. the docs
Следующее
От: Teodor Sigaev
Дата:
Сообщение: Re: [WIP] ALTER ... OWNER TO ... CASCADE