While trying to understand whether there was any difference, I noticed that CURRENT_ROLE is an undocumented synonymous for CURRENT_USER:
psql> SELECT CURRENT_ROLE; current_user -- not a typo, it really says "current_user" calvin sh> grep -i CURRENT_ROLE doc/src/sgml/*/*.sgml doc/src/sgml/*.sgml doc/src/sgml/keywords.sgml: <entry><token>CURRENT_ROLE</token></entry>Is there a special reason why it does not appear in the documentation? If not, I would suggest to apply the attached minimal documentation patch.
Also, there is a SESSION_USER, but no SESSION_ROLE. Not sure of the rationale.
-- Fabien.
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index f06d0a9..9ce1dd0 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -15736,6 +15736,12 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n); </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> <entry>name of current schema</entry>
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers