From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Allow GRANTED BY clause in normal GRANT and REVOKE statements
Date: Sat, 30 Jan 2021 08:51:16 +0000
Message-ID: <E1l5lyO-0004hY-1q@gemulon.postgresql.org> (raw)
Allow GRANTED BY clause in normal GRANT and REVOKE statements
The SQL standard allows a GRANTED BY clause on GRANT and
REVOKE (privilege) statements that can specify CURRENT_USER or
CURRENT_ROLE. In PostgreSQL, both of these are the default behavior.
Since we already have all the parsing support for this for the
GRANT (role) statement, we might as well add basic support for this
for the privilege variant as well. This allows us to check off SQL
feature T332. In the future, perhaps more interesting things could be
done with this, too.
Reviewed-by: Simon Riggs <simon@2ndquadrant.com>
Discussion: https://www.postgresql.org/message-id/flat/f2feac44-b4c5-f38f-3699-2851d6a76dc9@2ndquadrant.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/6aaaa76bb47db11cd6f567eafa3d1ee81ca59556
Modified Files
--------------
doc/src/sgml/ref/grant.sgml | 25 ++++++++++++++++++++++---
doc/src/sgml/ref/revoke.sgml | 13 +++++++++++++
src/backend/catalog/aclchk.c | 16 ++++++++++++++++
src/backend/catalog/sql_features.txt | 2 +-
src/backend/nodes/copyfuncs.c | 1 +
src/backend/nodes/equalfuncs.c | 1 +
src/backend/parser/gram.y | 13 ++++++++-----
src/include/nodes/parsenodes.h | 1 +
src/test/regress/expected/privileges.out | 6 ++++--
src/test/regress/sql/privileges.sql | 6 ++++--
10 files changed, 71 insertions(+), 13 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: peter@eisentraut.org
Subject: Re: pgsql: Allow GRANTED BY clause in normal GRANT and REVOKE statements
In-Reply-To: <E1l5lyO-0004hY-1q@gemulon.postgresql.org>
References: <E1l5lyO-0004hY-1q@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox