Re: SET ROLE and reserved roles - Mailing list pgsql-hackers

From Amit Langote
Subject Re: SET ROLE and reserved roles
Date
Msg-id 570EF571.7090206@lab.ntt.co.jp
Whole thread Raw
In response to Re: SET ROLE and reserved roles  (Stephen Frost <sfrost@snowman.net>)
Responses Re: SET ROLE and reserved roles
List pgsql-hackers
Hi Stephen,

On 2016/04/14 2:10, Stephen Frost wrote:
>> Amit Langote <Langote_Amit_f8@lab.ntt.co.jp <javascript:;>> writes:
>>> I observe this:
>>
>>> postgres=# SET ROLE TO NONE;
>>> SET
>>> postgres=# SET ROLE TO nonexistent;
>>> ERROR:  role "nonexistent" does not exist
>>> postgres=# SET ROLE TO pg_signal_backend;
>>> ERROR:  invalid value for parameter "role": "pg_signal_backend"
>>
>>> Is that behavior deliberate? Might it be better to handle the case
>>> specially much as setting to "none" works?
> 
> I don't think it makes sense to say the role doesn't exist when it does, in
> fact, exist.

Sorry, I didn't mean to say that we should error with "<reserved-role>
does not exist" on such SET ROLE attempts.  Like Michael, I was a bit
surprised to find that it output "invalid value for parameter".

So, if consensus emerges that we should indeed disallow SET ROLE
<reserved-role-spec>, I would +1 Michael's proposed GUC_check_err*()-based
patch.

Thanks,
Amit





pgsql-hackers by date:

Previous
From: Chapman Flack
Date:
Subject: Safe to apply HeapTupleHeaderGetDatum to a tuple from syscache?
Next
From: Stephen Frost
Date:
Subject: Re: SET ROLE and reserved roles