From 1c1c58c76cc53b56da24d0d87365acfdd84e325d Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 8 May 2001 21:06:43 +0000 Subject: Add SET SESSION AUTHORIZATION command. --- doc/src/sgml/ref/allfiles.sgml | 3 +- doc/src/sgml/ref/set_session_auth.sgml | 103 +++++++++++++++++++++++++++++++++ doc/src/sgml/reference.sgml | 4 +- 3 files changed, 107 insertions(+), 3 deletions(-) create mode 100644 doc/src/sgml/ref/set_session_auth.sgml (limited to 'doc/src') diff --git a/doc/src/sgml/ref/allfiles.sgml b/doc/src/sgml/ref/allfiles.sgml index e53bfc74529..aea2171cdfc 100644 --- a/doc/src/sgml/ref/allfiles.sgml +++ b/doc/src/sgml/ref/allfiles.sgml @@ -1,5 +1,5 @@ @@ -98,6 +98,7 @@ Complete list of usable sgml source files in this directory. + diff --git a/doc/src/sgml/ref/set_session_auth.sgml b/doc/src/sgml/ref/set_session_auth.sgml new file mode 100644 index 00000000000..ba3ec6fb542 --- /dev/null +++ b/doc/src/sgml/ref/set_session_auth.sgml @@ -0,0 +1,103 @@ + + + + 2001-04-21 + + + + SET SESSION AUTHORIZATION + SQL - Language Statements + + + + SET SESSION AUTHORIZATION + Set the session user identifier and the current user identifier + of the current SQL-session context + + + + +SET SESSION AUTHORIZATION 'username' + + + + + Description + + + This command sets the session user identifier and the current user + identifer of the current SQL-session context to be + username. + + + + The session user identifier is initially set to be the (possibly + authenticated) user name provided by the client. The current user + identifier is normally equal to the session user identifier, but + may change temporarily in the context of setuid + functions and similar mechanisms. The current user identifer is + relevant for permission checking. + + + + Execution of this command is only permitted if the initial session + user (the authenticated user) had the + superuser privilege. This permission is kept for the duration of a + connection; for example, it is possible to temporarily become an + unprivileged user and later switch back to become a superuser. + + + + + Examples + + +SELECT SESSION_USER, CURRENT_USER; + current_user | session_user +--------------+-------------- + peter | peter + +SET SESSION AUTHORIZATION 'paul'; + +SELECT SESSION_USER, CURRENT_USER; + current_user | session_user +--------------+-------------- + paul | paul + + + + + Compatibility + + SQL99 + + + SQL99 allows some other expressions to appear in place of the + literal username which are not important in + practice. PostgreSQL allows identifier + syntax ("username"), which SQL does not. SQL + does not allow this command during a transaction; + PostgreSQL does not make + this restriction because there is no reason to. The + privileges necessary to execute this command are left + implementation-defined by the standard. + + + + + diff --git a/doc/src/sgml/reference.sgml b/doc/src/sgml/reference.sgml index 9a977a6515c..57dcc7ed280 100644 --- a/doc/src/sgml/reference.sgml +++ b/doc/src/sgml/reference.sgml @@ -1,5 +1,5 @@ @@ -84,6 +84,7 @@ PostgreSQL Reference Manual &selectInto; &set; &setConstraints; + &setSessionAuth; &setTransaction; &show; &truncate; @@ -131,7 +132,6 @@ Disable this chapter until we have more functions documented. &dropuser; &ecpgRef; &pgAccess; - &pgAdmin; &pgConfig; &pgDump; &pgDumpall; -- cgit v1.2.3