Re: 9.0: plpgsql eror when restoring a database as a non superuser

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: 9.0: plpgsql eror when restoring a database as a non superuser
Дата
Msg-id 201110221309.22674.adrian.klaver@gmail.com
обсуждение исходный текст
Ответ на Re: 9.0: plpgsql eror when restoring a database as a non superuser  (stefan <stefan@therp.nl>)
Список pgsql-general
On Saturday, October 22, 2011 12:06:25 pm stefan wrote:
> >> Therefore the only solution I see is to drop plpgsql from template1, or
> >> writing a wrapper script that exploits the -l and -L options of
> >> pg_restore.
> >
> > Yes. Though I could see an option to create a template database without
> > plpgsql in it for use by non-superuser users and leave template1 as is.
>
> Adrian,
>
> Thanks for suggesting that. I had not thought about that option and it
> may just be the best.

Actually I was going to suggest something more. In the new template CREATE a
non-superuser ROLE and then as super user change ownership of the plpgsql to
that ROLE for that template and databases derived from it. That actually works
until you do the dump when it reverts ownership back to the postgres user. Not
quite sure why that is? At any rate a dead end.

>
> Cheers,
> Stefan.

--
Adrian Klaver
adrian.klaver@gmail.com

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

Предыдущее
От: stefan
Дата:
Сообщение: Re: 9.0: plpgsql eror when restoring a database as a non superuser
Следующее
От: Alexander Farber
Дата:
Сообщение: copying few fields into an existing table