CREATE INDEX: use the original userid for more ACL checks.
authorNoah Misch <[email protected]>
Sat, 25 Jun 2022 16:07:41 +0000 (09:07 -0700)
committerNoah Misch <[email protected]>
Sat, 25 Jun 2022 16:07:45 +0000 (09:07 -0700)
commit93731d549e15deb98cfab49f3d879beb1986daca
tree6e39fa0a9180a05ca976474d8084c40ad30a1dcd
parentec26f44d539a70cdca068392fc08b1137fd72fe8
CREATE INDEX: use the original userid for more ACL checks.

Commit a117cebd638dd02e5c2e791c25e43745f233111b used the original userid
for ACL checks located directly in DefineIndex(), but it still adopted
the table owner userid for more ACL checks than intended.  That broke
dump/reload of indexes that refer to an operator class, collation, or
exclusion operator in a schema other than "public" or "pg_catalog".
Back-patch to v10 (all supported versions), like the earlier commit.

Nathan Bossart and Noah Misch

Discussion: https://postgr.es/m/f8a4105f076544c180a87ef0c4822352@stmuk.bayern.de
contrib/citext/Makefile
contrib/citext/expected/create_index_acl.out [new file with mode: 0644]
contrib/citext/sql/create_index_acl.sql [new file with mode: 0644]
src/backend/commands/indexcmds.c