Document current_role.
authorTom Lane
Sat, 6 May 2017 18:19:47 +0000 (14:19 -0400)
committerTom Lane
Sat, 6 May 2017 18:20:06 +0000 (14:20 -0400)
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

doc/src/sgml/func.sgml

index 02dcd064374fb4e67e57f4bb8cfcfb08d0ef0009..2e7e2e2b251fe32d3be2a1c76fa225a482088e26 100644 (file)
@@ -13440,6 +13440,12 @@ postgres=# SELECT * FROM unnest2(ARRAY[[1,2],[3,4]]);
        by the client (might contain more than one statement)
       
 
+      
+       current_role
+       name
+       equivalent to current_user
+      
+
       
        current_schema[()]
        name
@@ -13551,8 +13557,11 @@ postgres=# SELECT * FROM unnest2(ARRAY[[1,2],[3,4]]);
 
    
     
-     current_catalogcurrent_schema,
-     current_usersession_user,
+     current_catalog,
+     current_role,
+     current_schema,
+     current_user,
+     session_user,
      and user have special syntactic status
      in SQL: they must be called without trailing
      parentheses.  (In PostgreSQL, parentheses can optionally be used with
@@ -13572,6 +13581,10 @@ postgres=# SELECT * FROM unnest2(ARRAY[[1,2],[3,4]]);
     current_query
    
 
+   
+    current_role
+   
+
    
     current_schema
    
@@ -13623,6 +13636,11 @@ postgres=# SELECT * FROM unnest2(ARRAY[[1,2],[3,4]]);
     functions with the attribute SECURITY DEFINER.
     In Unix parlance, the session user is the real user and
     the current user is the effective user.
+    current_role and user are
+    synonyms for current_user.  (The SQL standard draws
+    a distinction between current_role
+    and current_user, but PostgreSQL
+    does not, since it unifies users and roles into a single kind of entity.)