Skip to content

Commit a24a1a2

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 19a4033 commit a24a1a2

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
@@ -15306,6 +15306,12 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n);
1530615306
by the client (might contain more than one statement)</entry>
1530715307
</row>
1530815308

15309+
<row>
15310+
<entry><literal><function>current_role</function></literal></entry>
15311+
<entry><type>name</type></entry>
15312+
<entry>equivalent to <function>current_user</function></entry>
15313+
</row>
15314+
1530915315
<row>
1531015316
<entry><literal><function>current_schema</function>[()]</literal></entry>
1531115317
<entry><type>name</type></entry>
@@ -15429,8 +15435,11 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n);
1542915435

1543015436
<note>
1543115437
<para>
15432-
<function>current_catalog</function>, <function>current_schema</function>,
15433-
<function>current_user</function>, <function>session_user</function>,
15438+
<function>current_catalog</function>,
15439+
<function>current_role</function>,
15440+
<function>current_schema</function>,
15441+
<function>current_user</function>,
15442+
<function>session_user</function>,
1543415443
and <function>user</function> have special syntactic status
1543515444
in <acronym>SQL</acronym>: they must be called without trailing
1543615445
parentheses. (In PostgreSQL, parentheses can optionally be used with
@@ -15450,6 +15459,10 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n);
1545015459
<primary>current_query</primary>
1545115460
</indexterm>
1545215461

15462+
<indexterm>
15463+
<primary>current_role</primary>
15464+
</indexterm>
15465+
1545315466
<indexterm>
1545415467
<primary>current_schema</primary>
1545515468
</indexterm>
@@ -15501,6 +15514,11 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n);
1550115514
functions with the attribute <literal>SECURITY DEFINER</literal>.
1550215515
In Unix parlance, the session user is the <quote>real user</quote> and
1550315516
the current user is the <quote>effective user</quote>.
15517+
<function>current_role</function> and <function>user</function> are
15518+
synonyms for <function>current_user</function>. (The SQL standard draws
15519+
a distinction between <function>current_role</function>
15520+
and <function>current_user</function>, but <productname>PostgreSQL</>
15521+
does not, since it unifies users and roles into a single kind of entity.)
1550415522
</para>
1550515523

1550615524
<para>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy