postgres.git / summary / log / commit / refs
commit a24a1a2ec44d71cf43bdafc2c17db370cd1908ea
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: Sat May 06 18:19:47 2017 +0000
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
doc/src/sgml/func.sgml | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index e4102cdd17c..ca4aa51df66 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -15306,6 +15306,12 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n);
by the client (might contain more than one statement)</entry>
</row>
+ <row>
+ <entry><literal><function>current_role</function></literal></entry>
+ <entry><type>name</type></entry>
+ <entry>equivalent to <function>current_user</function></entry>
+ </row>
+
<row>
<entry><literal><function>current_schema</function>[()]</literal></entry>
<entry><type>name</type></entry>
@@ -15429,8 +15435,11 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n);
<note>
<para>
- <function>current_catalog</function>, <function>current_schema</function>,
- <function>current_user</function>, <function>session_user</function>,
+ <function>current_catalog</function>,
+ <function>current_role</function>,
+ <function>current_schema</function>,
+ <function>current_user</function>,
+ <function>session_user</function>,
and <function>user</function> have special syntactic status
in <acronym>SQL</acronym>: they must be called without trailing
parentheses. (In PostgreSQL, parentheses can optionally be used with
@@ -15450,6 +15459,10 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n);
<primary>current_query</primary>
</indexterm>
+ <indexterm>
+ <primary>current_role</primary>
+ </indexterm>
+
<indexterm>
<primary>current_schema</primary>
</indexterm>
@@ -15501,6 +15514,11 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n);
functions with the attribute <literal>SECURITY DEFINER</literal>.
In Unix parlance, the session user 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>
[parent: 19a40337854e]