diff options
author | Fujii Masao <fujii@postgresql.org> | 2025-04-04 19:02:17 +0900 |
---|---|---|
committer | Fujii Masao <fujii@postgresql.org> | 2025-04-04 19:02:17 +0900 |
commit | 0d6c4776647feeee26f3e29fff6a5edb222fa260 (patch) | |
tree | 117f30a1906c70ca5d5eb1d1727c15c6084b585e /doc/src | |
parent | 6e9c81836e101bc7f37ddc5e2f6ab58d62efcb24 (diff) | |
download | postgresql-0d6c4776647feeee26f3e29fff6a5edb222fa260.tar.gz postgresql-0d6c4776647feeee26f3e29fff6a5edb222fa260.zip |
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
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/catalogs.sgml | 3 | ||||
-rw-r--r-- | doc/src/sgml/ref/alter_default_privileges.sgml | 19 |
2 files changed, 18 insertions, 4 deletions
diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index 4558f940aaf..45ba9c5118f 100644 --- a/doc/src/sgml/catalogs.sgml +++ b/doc/src/sgml/catalogs.sgml @@ -3360,7 +3360,8 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l <literal>S</literal> = sequence, <literal>f</literal> = function, <literal>T</literal> = type, - <literal>n</literal> = schema + <literal>n</literal> = schema, + <literal>L</literal> = large object </para></entry> </row> diff --git a/doc/src/sgml/ref/alter_default_privileges.sgml b/doc/src/sgml/ref/alter_default_privileges.sgml index 89aacec4fab..6acd0f1df91 100644 --- a/doc/src/sgml/ref/alter_default_privileges.sgml +++ b/doc/src/sgml/ref/alter_default_privileges.sgml @@ -51,6 +51,11 @@ GRANT { { USAGE | CREATE } ON SCHEMAS TO { [ GROUP ] <replaceable class="parameter">role_name</replaceable> | PUBLIC } [, ...] [ WITH GRANT OPTION ] +GRANT { { SELECT | UPDATE } + [, ...] | ALL [ PRIVILEGES ] } + ON LARGE OBJECTS + TO { [ GROUP ] <replaceable class="parameter">role_name</replaceable> | PUBLIC } [, ...] [ WITH GRANT OPTION ] + REVOKE [ GRANT OPTION FOR ] { { SELECT | INSERT | UPDATE | DELETE | TRUNCATE | REFERENCES | TRIGGER | MAINTAIN } [, ...] | ALL [ PRIVILEGES ] } @@ -83,6 +88,13 @@ REVOKE [ GRANT OPTION FOR ] ON SCHEMAS FROM { [ GROUP ] <replaceable class="parameter">role_name</replaceable> | PUBLIC } [, ...] [ CASCADE | RESTRICT ] + +REVOKE [ GRANT OPTION FOR ] + { { SELECT | UPDATE } + [, ...] | ALL [ PRIVILEGES ] } + ON LARGE OBJECTS + FROM { [ GROUP ] <replaceable class="parameter">role_name</replaceable> | PUBLIC } [, ...] + [ CASCADE | RESTRICT ] </synopsis> </refsynopsisdiv> @@ -117,8 +129,8 @@ REVOKE [ GRANT OPTION FOR ] <para> Currently, only the privileges for schemas, tables (including views and foreign - tables), sequences, functions, and types (including domains) can be - altered. For this command, functions include aggregates and procedures. + tables), sequences, functions, types (including domains), and large objects + can be altered. For this command, functions include aggregates and procedures. The words <literal>FUNCTIONS</literal> and <literal>ROUTINES</literal> are equivalent in this command. (<literal>ROUTINES</literal> is preferred going forward as the standard term for functions and procedures taken @@ -161,7 +173,8 @@ REVOKE [ GRANT OPTION FOR ] If <literal>IN SCHEMA</literal> is omitted, the global default privileges are altered. <literal>IN SCHEMA</literal> is not allowed when setting privileges - for schemas, since schemas can't be nested. + for schemas and large objects, since schemas can't be nested and + large objects don't belong to a schema. </para> </listitem> </varlistentry> |