Re: SET ROLE and reserved roles

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: SET ROLE and reserved roles
Date: 2016-04-13 13:47:03
Message-ID: CA+TgmoaVu0cB4wVwfp4LNwRJQ83fAoXZWf3FPh85kqLRPz0=YA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Apr 13, 2016 at 8:49 AM, Michael Paquier
<michael(dot)paquier(at)gmail(dot)com> wrote:
> On Wed, Apr 13, 2016 at 5:58 PM, Amit Langote
> <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)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

But is it even intended behavior that you can't set to these reserved roles?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-04-13 13:50:09 Re: pg_upgrade documentation improvement patch
Previous Message Robert Haas 2016-04-13 13:46:09 Re: Missing PG_INT32_MIN in numutils.c