@@ -15735,6 +15735,12 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n);
15735
15735
by the client (might contain more than one statement)</entry>
15736
15736
</row>
15737
15737
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
+
15738
15744
<row>
15739
15745
<entry><literal><function>current_schema</function>[()]</literal></entry>
15740
15746
<entry><type>name</type></entry>
@@ -15871,8 +15877,11 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n);
15871
15877
15872
15878
<note>
15873
15879
<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>,
15876
15885
and <function>user</function> have special syntactic status
15877
15886
in <acronym>SQL</acronym>: they must be called without trailing
15878
15887
parentheses. (In PostgreSQL, parentheses can optionally be used with
@@ -15892,6 +15901,10 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n);
15892
15901
<primary>current_query</primary>
15893
15902
</indexterm>
15894
15903
15904
+ <indexterm>
15905
+ <primary>current_role</primary>
15906
+ </indexterm>
15907
+
15895
15908
<indexterm>
15896
15909
<primary>current_schema</primary>
15897
15910
</indexterm>
@@ -15943,6 +15956,11 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n);
15943
15956
functions with the attribute <literal>SECURITY DEFINER</literal>.
15944
15957
In Unix parlance, the session user is the <quote>real user</quote> and
15945
15958
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.)
15946
15964
</para>
15947
15965
15948
15966
<para>
0 commit comments