Small filx on the documentation of ALTER DEFAULT PRIVILEGES

Started by Yugo NAGATAover 1 year ago2 messages
#1Yugo NAGATA
nagata@sraoss.co.jp
1 attachment(s)

Hi,

Hi,

We can specify more than one privilege type in
"ALTER DEFAULT PRIVILEGES GRANT/REVOKE ON SCHEMAS",
for example,

ALTER DEFAULT PRIVILEGES GRANT USAGE,CREATE ON SCHEMAS TO PUBLIC;

However, the syntax described in the documentation looks to
be allowing only one,

GRANT { USAGE | CREATE | ALL [ PRIVILEGES ] }
ON SCHEMAS
TO { [ GROUP ] role_name | PUBLIC } [, ...] [ WITH GRANT OPTION ]

while the syntaxes for tables and sequences are described correctly.

e.g.
GRANT { { SELECT | INSERT | UPDATE | DELETE | TRUNCATE | REFERENCES | TRIGGER }
[, ...] | ALL [ PRIVILEGES ] }
ON TABLES
TO { [ GROUP ] role_name | PUBLIC } [, ...] [ WITH GRANT OPTION ]

I attached a small patch to fix the description.

Regards,
Yugo Nagata

--
Yugo NAGATA <nagata@sraoss.co.jp>

Attachments:

fix_doc_alter_default_privileges.patchtext/x-diff; name=fix_doc_alter_default_privileges.patchDownload
diff --git a/doc/src/sgml/ref/alter_default_privileges.sgml b/doc/src/sgml/ref/alter_default_privileges.sgml
index 1de4c5c1b4..89aacec4fa 100644
--- a/doc/src/sgml/ref/alter_default_privileges.sgml
+++ b/doc/src/sgml/ref/alter_default_privileges.sgml
@@ -46,7 +46,8 @@ GRANT { USAGE | ALL [ PRIVILEGES ] }
     ON TYPES
     TO { [ GROUP ] <replaceable class="parameter">role_name</replaceable> | PUBLIC } [, ...] [ WITH GRANT OPTION ]
 
-GRANT { USAGE | CREATE | ALL [ PRIVILEGES ] }
+GRANT { { USAGE | CREATE }
+    [, ...] | ALL [ PRIVILEGES ] }
     ON SCHEMAS
     TO { [ GROUP ] <replaceable class="parameter">role_name</replaceable> | PUBLIC } [, ...] [ WITH GRANT OPTION ]
 
@@ -77,7 +78,8 @@ REVOKE [ GRANT OPTION FOR ]
     [ CASCADE | RESTRICT ]
 
 REVOKE [ GRANT OPTION FOR ]
-    { USAGE | CREATE | ALL [ PRIVILEGES ] }
+    { { USAGE | CREATE }
+    [, ...] | ALL [ PRIVILEGES ] }
     ON SCHEMAS
     FROM { [ GROUP ] <replaceable class="parameter">role_name</replaceable> | PUBLIC } [, ...]
     [ CASCADE | RESTRICT ]
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Yugo NAGATA (#1)
Re: Small filx on the documentation of ALTER DEFAULT PRIVILEGES

Yugo NAGATA <nagata@sraoss.co.jp> writes:

We can specify more than one privilege type in
"ALTER DEFAULT PRIVILEGES GRANT/REVOKE ON SCHEMAS",
for example,

ALTER DEFAULT PRIVILEGES GRANT USAGE,CREATE ON SCHEMAS TO PUBLIC;

However, the syntax described in the documentation looks to
be allowing only one,

GRANT { USAGE | CREATE | ALL [ PRIVILEGES ] }
ON SCHEMAS
TO { [ GROUP ] role_name | PUBLIC } [, ...] [ WITH GRANT OPTION ]

while the syntaxes for tables and sequences are described correctly.

Yup, you're right. I'll push this shortly.

regards, tom lane