Re: SET ROLE and reserved roles

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: SET ROLE and reserved roles
Дата
Msg-id CAB7nPqRMjyntWs3YNyJAaBBRezVv1rPm47W6mTaipahmKHpiJw@mail.gmail.com
обсуждение исходный текст
Ответ на SET ROLE and reserved roles  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Ответы Re: SET ROLE and reserved roles
Список pgsql-hackers
On Wed, Apr 13, 2016 at 5:58 PM, Amit Langote
<Langote_Amit_f8@lab.ntt.co.jp> wrote:
> Is that behavior deliberate? Might it be better to handle the case
> specially much as setting to "none" works?  Such as:
>
> ERROR: cannot set to reserved role "pg_signal_backend"
>
> Sorry if I have missed any discussion where such a choice was deliberately
> made.

I agree that this is a bit surprising. We could do something like the
attached, and switch the error code to ERRCODE_RESERVED_NAME as well
without caring much if a system role exists or not, this does not seem
worth doing a catalog lookup:
=# set role to pg_test;
ERROR:  42939: role "pg_test" is reserved
LOCATION:  call_string_check_hook, guc.c:9788
=# set role to pg_signal_backend;
ERROR:  42939: role "pg_signal_backend" is reserved
LOCATION:  call_string_check_hook, guc.c:9788
--
Michael

Вложения

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Optimization for updating foreign tables in Postgres FDW
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Optimization for updating foreign tables in Postgres FDW