@@ -15306,6 +15306,12 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n);
15306
15306
by the client (might contain more than one statement)</entry>
15307
15307
</row>
15308
15308
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
+
15309
15315
<row>
15310
15316
<entry><literal><function>current_schema</function>[()]</literal></entry>
15311
15317
<entry><type>name</type></entry>
@@ -15429,8 +15435,11 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n);
15429
15435
15430
15436
<note>
15431
15437
<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>,
15434
15443
and <function>user</function> have special syntactic status
15435
15444
in <acronym>SQL</acronym>: they must be called without trailing
15436
15445
parentheses. (In PostgreSQL, parentheses can optionally be used with
@@ -15450,6 +15459,10 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n);
15450
15459
<primary>current_query</primary>
15451
15460
</indexterm>
15452
15461
15462
+ <indexterm>
15463
+ <primary>current_role</primary>
15464
+ </indexterm>
15465
+
15453
15466
<indexterm>
15454
15467
<primary>current_schema</primary>
15455
15468
</indexterm>
@@ -15501,6 +15514,11 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n);
15501
15514
functions with the attribute <literal>SECURITY DEFINER</literal>.
15502
15515
In Unix parlance, the session user is the <quote>real user</quote> and
15503
15516
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.)
15504
15522
</para>
15505
15523
15506
15524
<para>
0 commit comments