diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2017-05-06 14:19:47 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2017-05-06 14:20:01 -0400 |
commit | 8c681454dca0cf6a4dc8b48ca900851c046c4592 (patch) | |
tree | 78cb22da233c77ab87ed0fb803b72001d113e05c | |
parent | 41ba2ca080fe98ac4dc599f1e88328b030af8ace (diff) | |
download | postgresql-8c681454dca0cf6a4dc8b48ca900851c046c4592.tar.gz postgresql-8c681454dca0cf6a4dc8b48ca900851c046c4592.zip |
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
-rw-r--r-- | doc/src/sgml/func.sgml | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 90fa6e99924..b50fee0e2dc 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -14412,6 +14412,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> @@ -14522,8 +14528,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 @@ -14544,6 +14553,10 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n); </indexterm> <indexterm> + <primary>current_role</primary> + </indexterm> + + <indexterm> <primary>current_schema</primary> </indexterm> @@ -14594,6 +14607,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> |