Re: Changing table owner to db owner.

Поиск
Список
Период
Сортировка
От Paul McGarry
Тема Re: Changing table owner to db owner.
Дата
Msg-id AANLkTinVEm1uO93wQe6OUQwA+Rg=VPdHub579AaAS6vc@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Changing table owner to db owner.  (Adrian Klaver <adrian.klaver@gmail.com>)
Ответы Re: Changing table owner to db owner.  (Adrian Klaver <adrian.klaver@gmail.com>)
Список pgsql-general
On Wed, Dec 15, 2010 at 12:39 PM, Adrian Klaver <adrian.klaver@gmail.com> wrote:

> You did not say what version you are using. In 9.0 you have this option:
> http://www.postgresql.org/docs/9.0/interactive/sql-alterdefaultprivileges.html

Our servers are a mix of 8.3 and 8.4.

> I generally do as superuser;
>
> SET ROLE user;
> CREATE TABLE table_name;
>
> It requires you knowing the user_name/role_name for each db, though it would be
> possible to create a script that automates that by doing a lookup.

It's a pity something nasty like:
SET ROLE (select pg_get_userbyid(relowner) from pg_class where
relname='existingtable');
doesn't work.

Using SET ROLE like that is certainly helpful though, I have about ~30
to update so anything that makes it easier is a help.

Paul

В списке pgsql-general по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Changing table owner to db owner.
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: Understanding Schema's