@@ -13440,6 +13440,12 @@ postgres=# SELECT * FROM unnest2(ARRAY[[1,2],[3,4]]);
13440
13440
by the client (might contain more than one statement)</entry>
13441
13441
</row>
13442
13442
13443
+ <row>
13444
+ <entry><literal><function>current_role</function></literal></entry>
13445
+ <entry><type>name</type></entry>
13446
+ <entry>equivalent to <function>current_user</function></entry>
13447
+ </row>
13448
+
13443
13449
<row>
13444
13450
<entry><literal><function>current_schema</function>[()]</literal></entry>
13445
13451
<entry><type>name</type></entry>
@@ -13551,8 +13557,11 @@ postgres=# SELECT * FROM unnest2(ARRAY[[1,2],[3,4]]);
13551
13557
13552
13558
<note>
13553
13559
<para>
13554
- <function>current_catalog</function>, <function>current_schema</function>,
13555
- <function>current_user</function>, <function>session_user</function>,
13560
+ <function>current_catalog</function>,
13561
+ <function>current_role</function>,
13562
+ <function>current_schema</function>,
13563
+ <function>current_user</function>,
13564
+ <function>session_user</function>,
13556
13565
and <function>user</function> have special syntactic status
13557
13566
in <acronym>SQL</acronym>: they must be called without trailing
13558
13567
parentheses. (In PostgreSQL, parentheses can optionally be used with
@@ -13572,6 +13581,10 @@ postgres=# SELECT * FROM unnest2(ARRAY[[1,2],[3,4]]);
13572
13581
<primary>current_query</primary>
13573
13582
</indexterm>
13574
13583
13584
+ <indexterm>
13585
+ <primary>current_role</primary>
13586
+ </indexterm>
13587
+
13575
13588
<indexterm>
13576
13589
<primary>current_schema</primary>
13577
13590
</indexterm>
@@ -13623,6 +13636,11 @@ postgres=# SELECT * FROM unnest2(ARRAY[[1,2],[3,4]]);
13623
13636
functions with the attribute <literal>SECURITY DEFINER</literal>.
13624
13637
In Unix parlance, the session user is the <quote>real user</quote> and
13625
13638
the current user is the <quote>effective user</quote>.
13639
+ <function>current_role</function> and <function>user</function> are
13640
+ synonyms for <function>current_user</function>. (The SQL standard draws
13641
+ a distinction between <function>current_role</function>
13642
+ and <function>current_user</function>, but <productname>PostgreSQL</>
13643
+ does not, since it unifies users and roles into a single kind of entity.)
13626
13644
</para>
13627
13645
13628
13646
<para>
0 commit comments