Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a9c6d70

Browse files
committed
Document current_role.
This system function has been there a very long time, but somehow escaped being listed in func.sgml. Fabien Coelho and Tom Lane Discussion: https://postgr.es/m/alpine.DEB.2.20.1705061027580.3896@lancre
1 parent 54dbd4d commit a9c6d70

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

doc/src/sgml/func.sgml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15735,6 +15735,12 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n);
1573515735
by the client (might contain more than one statement)</entry>
1573615736
</row>
1573715737

15738+
<row>
15739+
<entry><literal><function>current_role</function></literal></entry>
15740+
<entry><type>name</type></entry>
15741+
<entry>equivalent to <function>current_user</function></entry>
15742+
</row>
15743+
1573815744
<row>
1573915745
<entry><literal><function>current_schema</function>[()]</literal></entry>
1574015746
<entry><type>name</type></entry>
@@ -15871,8 +15877,11 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n);
1587115877

1587215878
<note>
1587315879
<para>
15874-
<function>current_catalog</function>, <function>current_schema</function>,
15875-
<function>current_user</function>, <function>session_user</function>,
15880+
<function>current_catalog</function>,
15881+
<function>current_role</function>,
15882+
<function>current_schema</function>,
15883+
<function>current_user</function>,
15884+
<function>session_user</function>,
1587615885
and <function>user</function> have special syntactic status
1587715886
in <acronym>SQL</acronym>: they must be called without trailing
1587815887
parentheses. (In PostgreSQL, parentheses can optionally be used with
@@ -15892,6 +15901,10 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n);
1589215901
<primary>current_query</primary>
1589315902
</indexterm>
1589415903

15904+
<indexterm>
15905+
<primary>current_role</primary>
15906+
</indexterm>
15907+
1589515908
<indexterm>
1589615909
<primary>current_schema</primary>
1589715910
</indexterm>
@@ -15943,6 +15956,11 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n);
1594315956
functions with the attribute <literal>SECURITY DEFINER</literal>.
1594415957
In Unix parlance, the session user is the <quote>real user</quote> and
1594515958
the current user is the <quote>effective user</quote>.
15959+
<function>current_role</function> and <function>user</function> are
15960+
synonyms for <function>current_user</function>. (The SQL standard draws
15961+
a distinction between <function>current_role</function>
15962+
and <function>current_user</function>, but <productname>PostgreSQL</>
15963+
does not, since it unifies users and roles into a single kind of entity.)
1594615964
</para>
1594715965

1594815966
<para>

0 commit comments

Comments
 (0)