This page in other versions: Unsupported versions: 7.1 / 7.2 / 7.3 / 7.4

4.11. Miscellaneous Functions

Table 4-21. Miscellaneous Functions

Name Return Type Description
current_user name user name of current execution context
session_user name session user name
user name equivalent to current_user

The session_user is the user that initiated a database connection and is fixed for the duration of that connection. The 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 "setuid" functions and other facilities to allow the current user to change temporarily. In Unix parlance, the session user is the "real user" and the current user is the "effective user".

Note that these functions have special syntactic status in SQL; they must be called without trailing parentheses.

Deprecated: The function getpgusername() is an obsolete equivalent of current_user.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group