Re: [HACKERS] "CURRENT_ROLE" is not documented - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] "CURRENT_ROLE" is not documented
Date
Msg-id 28362.1494095771@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] "CURRENT_ROLE" is not documented  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: [HACKERS] "CURRENT_ROLE" is not documented  (Fabien COELHO <coelho@cri.ensmp.fr>)
List pgsql-hackers
Fabien COELHO <coelho@cri.ensmp.fr> writes:
>> I agree we ought to document this, but we likely need to mention
>> the discrepancy from the spec, too.

> Yep. A little subtle, though. Maybe it is enough to just say that for pg a
> user is a role, which is not the case in the standard?

I did it like this:

*** 15943,15948 ****
--- 15956,15966 ----     functions with the attribute <literal>SECURITY DEFINER</literal>.     In Unix parlance, the
sessionuser is the <quote>real user</quote> and     the current user is the <quote>effective user</quote>. 
+     <function>current_role</function> and <function>user</function> are
+     synonyms for <function>current_user</function>.  (The SQL standard draws
+     a distinction between <function>current_role</function>
+     and <function>current_user</function>, but <productname>PostgreSQL</>
+     does not, since it unifies users and roles into a single kind of entity.)    </para>     <para>

I stole the "unifies..." language out of the CREATE ROLE page.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: [HACKERS] "CURRENT_ROLE" is not documented
Next
From: Noah Misch
Date:
Subject: Re: [HACKERS] SUBSCRIPTIONS and pg_upgrade