Allow CURRENT_ROLE where CURRENT_USER is accepted

Peter Eisentraut <peter@eisentraut.org>

Commit: 45b9805706fdc726906fc9187c9a7b38c559755c
Author: Peter Eisentraut <peter@eisentraut.org>
Date: 2020-09-17T09:40:08Z
Releases: 14.0
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

Files

PathChange+/−
doc/src/sgml/ref/alter_aggregate.sgml modified +1 −1
doc/src/sgml/ref/alter_collation.sgml modified +1 −1
doc/src/sgml/ref/alter_conversion.sgml modified +1 −1
doc/src/sgml/ref/alter_database.sgml modified +1 −1
doc/src/sgml/ref/alter_domain.sgml modified +1 −1
doc/src/sgml/ref/alter_event_trigger.sgml modified +1 −1
doc/src/sgml/ref/alter_foreign_data_wrapper.sgml modified +1 −1
doc/src/sgml/ref/alter_foreign_table.sgml modified +1 −1
doc/src/sgml/ref/alter_function.sgml modified +1 −1
doc/src/sgml/ref/alter_group.sgml modified +1 −0
doc/src/sgml/ref/alter_language.sgml modified +1 −1
doc/src/sgml/ref/alter_large_object.sgml modified +1 −1
doc/src/sgml/ref/alter_materialized_view.sgml modified +1 −1
doc/src/sgml/ref/alter_opclass.sgml modified +1 −1
doc/src/sgml/ref/alter_operator.sgml modified +1 −1
doc/src/sgml/ref/alter_opfamily.sgml modified +1 −1
doc/src/sgml/ref/alter_policy.sgml modified +1 −1
doc/src/sgml/ref/alter_procedure.sgml modified +1 −1
doc/src/sgml/ref/alter_publication.sgml modified +1 −1
doc/src/sgml/ref/alter_role.sgml modified +2 −0
doc/src/sgml/ref/alter_routine.sgml modified +1 −1
doc/src/sgml/ref/alter_schema.sgml modified +1 −1
doc/src/sgml/ref/alter_sequence.sgml modified +1 −1
doc/src/sgml/ref/alter_server.sgml modified +1 −1
doc/src/sgml/ref/alter_statistics.sgml modified +1 −1
doc/src/sgml/ref/alter_subscription.sgml modified +1 −1
doc/src/sgml/ref/alter_table.sgml modified +1 −1
doc/src/sgml/ref/alter_tablespace.sgml modified +1 −1
doc/src/sgml/ref/alter_tsconfig.sgml modified +1 −1
doc/src/sgml/ref/alter_tsdictionary.sgml modified +1 −1
doc/src/sgml/ref/alter_type.sgml modified +1 −1
doc/src/sgml/ref/alter_user_mapping.sgml modified +2 −2
doc/src/sgml/ref/alter_user.sgml modified +1 −0
doc/src/sgml/ref/alter_view.sgml modified +1 −1
doc/src/sgml/ref/create_policy.sgml modified +1 −1
doc/src/sgml/ref/create_schema.sgml modified +1 −0
doc/src/sgml/ref/create_tablespace.sgml modified +1 −1
doc/src/sgml/ref/create_user_mapping.sgml modified +2 −2
doc/src/sgml/ref/drop_owned.sgml modified +1 −1
doc/src/sgml/ref/drop_user_mapping.sgml modified +2 −2
doc/src/sgml/ref/grant.sgml modified +1 −0
doc/src/sgml/ref/reassign_owned.sgml modified +2 −2
doc/src/sgml/ref/revoke.sgml modified +1 −0
src/backend/parser/gram.y modified +11 −0
src/backend/utils/adt/acl.c modified +2 −0
src/include/nodes/parsenodes.h modified +1 −0
src/test/modules/unsafe_tests/expected/rolenames.out modified +351 −271
src/test/modules/unsafe_tests/sql/rolenames.sql modified +121 −104

Documentation touched

Discussion