pgsql: Introduce SYSTEM_USER - Mailing list pgsql-committers

From Michael Paquier
Subject pgsql: Introduce SYSTEM_USER
Date
Msg-id E1odmhl-00060i-FC@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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 by 9afffcb (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 to d951052, 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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0823d061b0b7f1e20fbfd48bef3c2e093493dbd4

Modified Files
--------------
doc/src/sgml/func.sgml                    | 19 ++++++++++++
src/backend/access/transam/parallel.c     |  8 +++++
src/backend/parser/gram.y                 | 11 ++++++-
src/backend/utils/adt/ruleutils.c         |  4 +++
src/backend/utils/init/miscinit.c         | 50 +++++++++++++++++++++++++++++++
src/backend/utils/init/postinit.c         |  4 +++
src/include/catalog/catversion.h          |  2 +-
src/include/catalog/pg_proc.dat           |  3 ++
src/include/miscadmin.h                   |  3 ++
src/include/parser/kwlist.h               |  1 +
src/test/authentication/t/001_password.pl | 42 ++++++++++++++++++++++++++
src/test/kerberos/t/001_auth.pl           | 28 +++++++++++++++--
src/test/regress/expected/create_view.out |  6 ++--
src/test/regress/sql/create_view.sql      |  3 +-
14 files changed, 177 insertions(+), 7 deletions(-)


pgsql-committers by date:

Previous
From: Michael Paquier
Date:
Subject: pgsql: Mark sigint_interrupt_enabled as sig_atomic_t
Next
From: Jaime Casanova
Date:
Subject: Re: pgsql: Avoid improbable PANIC during heap_update.