mirror of
https://github.com/postgres/postgres.git
synced 2025-07-17 06:41:09 +03:00
Introduce SYSTEM_USER
SYSTEM_USER is a reserved keyword of the SQL specification that, roughly described, is aimed at reporting some information about the system user who has connected to the database server. It may include implementation-specific information about the means by the user connected, like an authentication method. This commit implements SYSTEM_USER as of auth_method:identity, where "auth_method" is a keyword about the authentication method used to log into the server (like peer, md5, scram-sha-256, gss, etc.) and "identity" is the authentication identity as introduced by9afffcb
(peer sets authn to the OS user name, gss to the user principal, etc.). This format has been suggested by Tom Lane. Note that thanks tod951052
, SYSTEM_USER is available to parallel workers. Bump catalog version. Author: Bertrand Drouvot Reviewed-by: Jacob Champion, Joe Conway, Álvaro Herrera, Michael Paquier Discussion: https://postgr.es/m/7e692b8c-0b11-45db-1cad-3afc5b57409f@amazon.com
This commit is contained in:
@ -743,7 +743,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
|
||||
SERIALIZABLE SERVER SESSION SESSION_USER SET SETS SETOF SHARE SHOW
|
||||
SIMILAR SIMPLE SKIP SMALLINT SNAPSHOT SOME SQL_P STABLE STANDALONE_P
|
||||
START STATEMENT STATISTICS STDIN STDOUT STORAGE STORED STRICT_P STRIP_P
|
||||
SUBSCRIPTION SUBSTRING SUPPORT SYMMETRIC SYSID SYSTEM_P
|
||||
SUBSCRIPTION SUBSTRING SUPPORT SYMMETRIC SYSID SYSTEM_P SYSTEM_USER
|
||||
|
||||
TABLE TABLES TABLESAMPLE TABLESPACE TEMP TEMPLATE TEMPORARY TEXT_P THEN
|
||||
TIES TIME TIMESTAMP TO TRAILING TRANSACTION TRANSFORM
|
||||
@ -15239,6 +15239,13 @@ func_expr_common_subexpr:
|
||||
{
|
||||
$$ = makeSQLValueFunction(SVFOP_SESSION_USER, -1, @1);
|
||||
}
|
||||
| SYSTEM_USER
|
||||
{
|
||||
$$ = (Node *) makeFuncCall(SystemFuncName("system_user"),
|
||||
NIL,
|
||||
COERCE_SQL_SYNTAX,
|
||||
@1);
|
||||
}
|
||||
| USER
|
||||
{
|
||||
$$ = makeSQLValueFunction(SVFOP_USER, -1, @1);
|
||||
@ -17120,6 +17127,7 @@ reserved_keyword:
|
||||
| SESSION_USER
|
||||
| SOME
|
||||
| SYMMETRIC
|
||||
| SYSTEM_USER
|
||||
| TABLE
|
||||
| THEN
|
||||
| TO
|
||||
@ -17500,6 +17508,7 @@ bare_label_keyword:
|
||||
| SYMMETRIC
|
||||
| SYSID
|
||||
| SYSTEM_P
|
||||
| SYSTEM_USER
|
||||
| TABLE
|
||||
| TABLES
|
||||
| TABLESAMPLE
|
||||
|
Reference in New Issue
Block a user