From 8c681454dca0cf6a4dc8b48ca900851c046c4592 Mon Sep 17 00:00:00 2001
From: Tom Lane
Date: Sat, 6 May 2017 14:19:47 -0400
Subject: 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
---
doc/src/sgml/func.sgml | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
(limited to 'doc/src')
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
@@ -14411,6 +14411,12 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n);
by the client (might contain more than one statement)
+
+ current_role
+ name
+ equivalent to current_user
+
+
current_schema[()]
name
@@ -14522,8 +14528,11 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n);
- current_catalog, current_schema,
- current_user, session_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
@@ -14543,6 +14552,10 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n);
current_query
+
+ current_role
+
+
current_schema
@@ -14594,6 +14607,11 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n);
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.)
--
cgit v1.2.3