Allow GRANTED BY clause in normal GRANT and REVOKE statements
authorPeter Eisentraut <peter@eisentraut.org>
Sat, 30 Jan 2021 08:41:44 +0000 (09:41 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Sat, 30 Jan 2021 08:45:11 +0000 (09:45 +0100)
commit6aaaa76bb47db11cd6f567eafa3d1ee81ca59556
tree06c71bb1c342258f85f97ecc7c7b02cda193895c
parent7da83415e5bc01bba0093f34f4f612b70c70b678
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
doc/src/sgml/ref/grant.sgml
doc/src/sgml/ref/revoke.sgml
src/backend/catalog/aclchk.c
src/backend/catalog/sql_features.txt
src/backend/nodes/copyfuncs.c
src/backend/nodes/equalfuncs.c
src/backend/parser/gram.y
src/include/nodes/parsenodes.h
src/test/regress/expected/privileges.out
src/test/regress/sql/privileges.sql