pgsql: Extend ALTER DEFAULT PRIVILEGES to define default privileges for

From: Fujii Masao <fujii(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Extend ALTER DEFAULT PRIVILEGES to define default privileges for
Date: 2025-04-04 10:04:31
Message-ID: E1u0duZ-002buv-27@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(at)sraoss(dot)co(dot)jp>
Co-authored-by: Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>
Co-authored-by: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Reviewed-by: Masao Fujii <masao(dot)fujii(at)gmail(dot)com>
Discussion: https://postgr.es/m/20240424115242.236b499b2bed5b7a27f7a418@sraoss.co.jp

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0d6c4776647feeee26f3e29fff6a5edb222fa260

Modified Files
--------------
doc/src/sgml/catalogs.sgml | 3 +-
doc/src/sgml/ref/alter_default_privileges.sgml | 19 +++++-
src/backend/catalog/aclchk.c | 21 ++++++
src/backend/catalog/objectaddress.c | 18 ++++-
src/backend/catalog/pg_largeobject.c | 18 ++++-
src/backend/parser/gram.y | 5 +-
src/bin/pg_dump/dumputils.c | 3 +-
src/bin/pg_dump/pg_dump.c | 3 +
src/bin/psql/describe.c | 6 +-
src/bin/psql/tab-complete.in.c | 2 +-
src/include/catalog/pg_default_acl.h | 1 +
src/include/parser/kwlist.h | 1 +
src/test/regress/expected/privileges.out | 94 +++++++++++++++++++++++++-
src/test/regress/sql/privileges.sql | 36 ++++++++++
14 files changed, 217 insertions(+), 13 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2025-04-04 10:31:12 pgsql: Support non-btree indexes in get_actual_variable_range()
Previous Message Heikki Linnakangas 2025-04-04 09:58:01 pgsql: Use standard die() signal handler in walreceiver