Extend ALTER DEFAULT PRIVILEGES to define default privileges for large objects.
authorFujii Masao <fujii@postgresql.org>
Fri, 4 Apr 2025 10:02:17 +0000 (19:02 +0900)
committerFujii Masao <fujii@postgresql.org>
Fri, 4 Apr 2025 10:02:17 +0000 (19:02 +0900)
commit0d6c4776647feeee26f3e29fff6a5edb222fa260
tree117f30a1906c70ca5d5eb1d1727c15c6084b585e
parent6e9c81836e101bc7f37ddc5e2f6ab58d62efcb24
Extend ALTER DEFAULT PRIVILEGES to define default privileges for large objects.

Previously, ALTER DEFAULT PRIVILEGES did not support large objects.
This meant that to grant privileges to users other than the owner,
permissions had to be manually assigned each time a large object
was created, which was inconvenient.

This commit extends ALTER DEFAULT PRIVILEGES to allow defining default
access privileges for large objects. With this change, specified privileges
will automatically apply to newly created large objects, making privilege
management more efficient.

As a side effect, this commit introduces the new keyword OBJECTS
since it's used in the syntax of ALTER DEFAULT PRIVILEGES.

Original patch by Haruka Takatsuka, with some fixes and tests by Yugo Nagata,
and rebased by Laurenz Albe.

Author: Takatsuka Haruka <harukat@sraoss.co.jp>
Co-authored-by: Yugo Nagata <nagata@sraoss.co.jp>
Co-authored-by: Laurenz Albe <laurenz.albe@cybertec.at>
Reviewed-by: Masao Fujii <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/20240424115242.236b499b2bed5b7a27f7a418@sraoss.co.jp
14 files changed:
doc/src/sgml/catalogs.sgml
doc/src/sgml/ref/alter_default_privileges.sgml
src/backend/catalog/aclchk.c
src/backend/catalog/objectaddress.c
src/backend/catalog/pg_largeobject.c
src/backend/parser/gram.y
src/bin/pg_dump/dumputils.c
src/bin/pg_dump/pg_dump.c
src/bin/psql/describe.c
src/bin/psql/tab-complete.in.c
src/include/catalog/pg_default_acl.h
src/include/parser/kwlist.h
src/test/regress/expected/privileges.out
src/test/regress/sql/privileges.sql