October 2001
Beginner to intermediate
400 pages
7h 45m
English
Several of the included functions in PostgreSQL deal with user and session issues. The following sections discuss user-related functions.
The CURRENT_USER function returns the user ID being used for permission checking.
None.
SELECT CURRENT_USER; -------------- webuser
Currently, CURRENT_USER and SESSION_USER are the same, but in the future, there might be a distinction as needed for programs running in a setuid mode.
Notice that the preceding function is not called with the trailing parentheses “()”. This is to maintain SQL compatibility.
The SESSION_USER function returns the user ID that is currently logged into PostgreSQL.
None.
Read now
Unlock full access