Allow CURRENT_ROLE where CURRENT_USER is accepted
authorPeter Eisentraut <peter@eisentraut.org>
Thu, 17 Sep 2020 09:39:28 +0000 (11:39 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Thu, 17 Sep 2020 09:40:08 +0000 (11:40 +0200)
commit45b9805706fdc726906fc9187c9a7b38c559755c
treeef61233750b2bb15746a08f7001d927196f5c965
parent16fa9b2b30a357b4aea982bd878ec2e5e002dbcc
Allow CURRENT_ROLE where CURRENT_USER is accepted

In the particular case of GRANTED BY, this is specified in the SQL
standard.  Since in PostgreSQL, CURRENT_ROLE is equivalent to
CURRENT_USER, and CURRENT_USER is already supported here, adding
CURRENT_ROLE is trivial.  The other cases are PostgreSQL extensions,
but for the same reason it also makes sense there.

Reviewed-by: Vik Fearing <vik@postgresfriends.org>
Reviewed-by: Asif Rehman <asifr.rehman@gmail.com>
Reviewed-by: Alvaro Herrera <alvherre@2ndquadrant.com>
Discussion: https://www.postgresql.org/message-id/flat/f2feac44-b4c5-f38f-3699-2851d6a76dc9%402ndquadrant.com
48 files changed:
doc/src/sgml/ref/alter_aggregate.sgml
doc/src/sgml/ref/alter_collation.sgml
doc/src/sgml/ref/alter_conversion.sgml
doc/src/sgml/ref/alter_database.sgml
doc/src/sgml/ref/alter_domain.sgml
doc/src/sgml/ref/alter_event_trigger.sgml
doc/src/sgml/ref/alter_foreign_data_wrapper.sgml
doc/src/sgml/ref/alter_foreign_table.sgml
doc/src/sgml/ref/alter_function.sgml
doc/src/sgml/ref/alter_group.sgml
doc/src/sgml/ref/alter_language.sgml
doc/src/sgml/ref/alter_large_object.sgml
doc/src/sgml/ref/alter_materialized_view.sgml
doc/src/sgml/ref/alter_opclass.sgml
doc/src/sgml/ref/alter_operator.sgml
doc/src/sgml/ref/alter_opfamily.sgml
doc/src/sgml/ref/alter_policy.sgml
doc/src/sgml/ref/alter_procedure.sgml
doc/src/sgml/ref/alter_publication.sgml
doc/src/sgml/ref/alter_role.sgml
doc/src/sgml/ref/alter_routine.sgml
doc/src/sgml/ref/alter_schema.sgml
doc/src/sgml/ref/alter_sequence.sgml
doc/src/sgml/ref/alter_server.sgml
doc/src/sgml/ref/alter_statistics.sgml
doc/src/sgml/ref/alter_subscription.sgml
doc/src/sgml/ref/alter_table.sgml
doc/src/sgml/ref/alter_tablespace.sgml
doc/src/sgml/ref/alter_tsconfig.sgml
doc/src/sgml/ref/alter_tsdictionary.sgml
doc/src/sgml/ref/alter_type.sgml
doc/src/sgml/ref/alter_user.sgml
doc/src/sgml/ref/alter_user_mapping.sgml
doc/src/sgml/ref/alter_view.sgml
doc/src/sgml/ref/create_policy.sgml
doc/src/sgml/ref/create_schema.sgml
doc/src/sgml/ref/create_tablespace.sgml
doc/src/sgml/ref/create_user_mapping.sgml
doc/src/sgml/ref/drop_owned.sgml
doc/src/sgml/ref/drop_user_mapping.sgml
doc/src/sgml/ref/grant.sgml
doc/src/sgml/ref/reassign_owned.sgml
doc/src/sgml/ref/revoke.sgml
src/backend/parser/gram.y
src/backend/utils/adt/acl.c
src/include/nodes/parsenodes.h
src/test/modules/unsafe_tests/expected/rolenames.out
src/test/modules/unsafe_tests/sql/rolenames.sql