summaryrefslogtreecommitdiff
path: root/doc/src/sgml/func.sgml
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2000-09-19 18:18:04 +0000
committerPeter Eisentraut <peter_e@gmx.net>2000-09-19 18:18:04 +0000
commit457ac0331cd3e28ecc5d783e7504645837c41a1d (patch)
treeba4676d77b28de759955919a8dc14303fb7330bc /doc/src/sgml/func.sgml
parente9c3f0255fb54600e1c03533cc2e72d78928634d (diff)
downloadpostgresql-457ac0331cd3e28ecc5d783e7504645837c41a1d.tar.gz
Implement differentiation between CURRENT_USER and SESSION_USER as per SQL.
There is still no effective difference but it will kick in once setuid functions exist (not included here). Make old getpgusername() alias for current_user.
Diffstat (limited to 'doc/src/sgml/func.sgml')
-rw-r--r--doc/src/sgml/func.sgml55
1 files changed, 55 insertions, 0 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 9f8fdd8932..0306f7cf05 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -1510,6 +1510,61 @@ Not defined by this name. Implements the intersection operator '#'
</sect1>
<sect1>
+ <title id="misc-funcs">Miscellaneous Functions</>
+
+ <table>
+ <title>Miscellaneous Functions</>
+ <tgroup cols="3">
+ <thead>
+ <row><entry>Name</> <entry>Return type</> <entry>Description</></row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>current_user</>
+ <entry>name</>
+ <entry>user name of current execution context</>
+ </row>
+ <row>
+ <entry>user</>
+ <entry>name</>
+ <entry>equivalent to <function>current_user</></>
+ </row>
+ <row>
+ <entry>session_user</>
+ <entry>name</>
+ <entry>session user name</>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>
+ The <function>session_user</> is the user that initiated a database
+ connection and is fixed for the duration of that connection. The
+ <function>current_user</> is the user identifier that is applicable
+ for permission checking. Currently it is always equal to the session
+ user, but in the future there might be <quote>setuid</> functions and
+ other facilities to allow the current user to change temporarily.
+ In Unix parlance, the session user is the <quote>real user</>
+ and the current user is the <quote>effective user</>.
+ </para>
+
+ <para>
+ Note that these functions have special syntactic status in <acronym>SQL</>;
+ they must be called without trailing parentheses.
+ </para>
+
+ <note>
+ <title>Deprecated</>
+ <para>
+ The function <function>getpgusername()</> is an obsolete equivalent
+ of <function>current_user</>.
+ </para>
+ </note>
+ </sect1>
+
+ <sect1>
<title id="aggregate-funcs">Aggregate Functions</title>
<note>