agora inbox for pgsql-docs@postgresql.org
help / color / mirror / Atom feed"GRANT on Roles" supports multiple options
2+ messages / 2 participants
[nested] [flat]
* "GRANT on Roles" supports multiple options
@ 2025-05-08 14:53 PG Doc comments form <noreply@postgresql.org>
0 siblings, 1 reply; 2+ messages in thread
From: PG Doc comments form @ 2025-05-08 14:53 UTC (permalink / raw)
To: pgsql-docs@lists.postgresql.org; +Cc: polushin@gmail.com
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/17/docguide.html
Description:
Hi!
In the documentation of the GRANT[1] command, the Synopsis for "GRANT on
Roles" command is incomplete. Quoting from the current docs:
GRANT role_name [, ...] TO role_specification [, ...]
[ WITH { ADMIN | INHERIT | SET } { OPTION | TRUE | FALSE } ]
[ GRANTED BY role_specification ]
The "GRANT on Roles" command is documented as if it expects a single option
after "WITH", but it actually supports multiple options, separated by comma,
e.g.
GRANT created_user TO creating_user WITH ADMIN TRUE, SET FALSE, INHERIT
FALSE
The example is taken from section "21.2. Role Attributes"[2] of the
documentation.
More examples can be found by searching the codebase:
git grep -Pi '\bGRANT\b.+\bTO\b.+,\s*(ADMIN|INHERIT|SET)\s+\w+'
The parser is implemented here:
src/backend/commands/user.c:1480:GrantRole(ParseState *pstate,
GrantRoleStmt *stmt)
The documentation is to be corrected for v16, v17, and later versions.
[1]: https://www.postgresql.org/docs/17/sql-grant.html
[2]: https://www.postgresql.org/docs/17/role-attributes.html
diff --git a/doc/src/sgml/ref/grant.sgml b/doc/src/sgml/ref/grant.sgml
index 999f657d5c0..9796e9a49d7 100644
--- a/doc/src/sgml/ref/grant.sgml
+++ b/doc/src/sgml/ref/grant.sgml
@@ -100,3 +100,3 @@ GRANT { USAGE | ALL [ PRIVILEGES ] }
GRANT <replaceable class="parameter">role_name</replaceable> [, ...] TO
<replaceable class="parameter">role_specification</replaceable> [, ...]
- [ WITH { ADMIN | INHERIT | SET } { OPTION | TRUE | FALSE } ]
+ [ WITH [ { ADMIN | INHERIT | SET } { OPTION | TRUE | FALSE } ] [, ...]
]
[ GRANTED BY <replaceable
class="parameter">role_specification</replaceable> ]
--
Andrei Polushin
^ permalink raw reply [nested|flat] 2+ messages in thread
* "GRANT on Roles" supports multiple options
@ 2025-05-08 14:58 Andrei Polushin <polushin@gmail.com>
parent: PG Doc comments form <noreply@postgresql.org>
0 siblings, 0 replies; 2+ messages in thread
From: Andrei Polushin @ 2025-05-08 14:58 UTC (permalink / raw)
To: pgsql-docs@lists.postgresql.org
(resending with correct formatting)
Hi!
In the documentation of the GRANT[1] command, the Synopsis for "GRANT on Roles" command is incomplete. Quoting from the current docs:
GRANT role_name [, ...] TO role_specification [, ...]
[ WITH { ADMIN | INHERIT | SET } { OPTION | TRUE | FALSE } ]
[ GRANTED BY role_specification ]
The "GRANT on Roles" command is documented as if it expects a single option after "WITH", but it actually supports multiple options, separated by comma, e.g.
GRANT created_user TO creating_user WITH ADMIN TRUE, SET FALSE, INHERIT FALSE
The example is taken from section "21.2. Role Attributes"[2] of the documentation.
More examples can be found by searching the codebase:
git grep -Pi '\bGRANT\b.+\bTO\b.+,\s*(ADMIN|INHERIT|SET)\s+\w+'
The parser is implemented here:
src/backend/commands/user.c:1480:GrantRole(ParseState *pstate, GrantRoleStmt *stmt)
The documentation is to be corrected for v16, v17, and later versions.
[1]: https://www.postgresql.org/docs/17/sql-grant.html
[2]: https://www.postgresql.org/docs/17/role-attributes.html
diff --git a/doc/src/sgml/ref/grant.sgml b/doc/src/sgml/ref/grant.sgml
index 999f657d5c0..9796e9a49d7 100644
--- a/doc/src/sgml/ref/grant.sgml
+++ b/doc/src/sgml/ref/grant.sgml
@@ -100,3 +100,3 @@ GRANT { USAGE | ALL [ PRIVILEGES ] }
GRANT <replaceable class="parameter">role_name</replaceable> [, ...] TO <replaceable class="parameter">role_specification</replaceable> [, ...]
- [ WITH { ADMIN | INHERIT | SET } { OPTION | TRUE | FALSE } ]
+ [ WITH [ { ADMIN | INHERIT | SET } { OPTION | TRUE | FALSE } ] [, ...] ]
[ GRANTED BY <replaceable class="parameter">role_specification</replaceable> ]
--
Andrei Polushin
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2025-05-08 14:58 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-05-08 14:53 "GRANT on Roles" supports multiple options PG Doc comments form <noreply@postgresql.org>
2025-05-08 14:58 ` Andrei Polushin <polushin@gmail.com>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox