mirror of
https://github.com/postgres/postgres.git
synced 2025-05-12 16:21:30 +03:00
Update some obsolete stuff in the GRANT and REVOKE reference pages:
simplify the syntax examples by unifying user and group cases, and fix no-longer-correct example of psql \z output. Per Erwin Brandstetter.
This commit is contained in:
parent
897313e824
commit
406ee67c9a
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$PostgreSQL: pgsql/doc/src/sgml/ref/grant.sgml,v 1.66 2007/06/03 17:06:13 tgl Exp $
|
$PostgreSQL: pgsql/doc/src/sgml/ref/grant.sgml,v 1.67 2007/10/30 19:43:30 tgl Exp $
|
||||||
PostgreSQL documentation
|
PostgreSQL documentation
|
||||||
-->
|
-->
|
||||||
|
|
||||||
@ -23,34 +23,34 @@ PostgreSQL documentation
|
|||||||
GRANT { { SELECT | INSERT | UPDATE | DELETE | REFERENCES | TRIGGER }
|
GRANT { { SELECT | INSERT | UPDATE | DELETE | REFERENCES | TRIGGER }
|
||||||
[,...] | ALL [ PRIVILEGES ] }
|
[,...] | ALL [ PRIVILEGES ] }
|
||||||
ON [ TABLE ] <replaceable class="PARAMETER">tablename</replaceable> [, ...]
|
ON [ TABLE ] <replaceable class="PARAMETER">tablename</replaceable> [, ...]
|
||||||
TO { <replaceable class="PARAMETER">username</replaceable> | GROUP <replaceable class="PARAMETER">groupname</replaceable> | PUBLIC } [, ...] [ WITH GRANT OPTION ]
|
TO { [ GROUP ] <replaceable class="PARAMETER">rolename</replaceable> | PUBLIC } [, ...] [ WITH GRANT OPTION ]
|
||||||
|
|
||||||
GRANT { { USAGE | SELECT | UPDATE }
|
GRANT { { USAGE | SELECT | UPDATE }
|
||||||
[,...] | ALL [ PRIVILEGES ] }
|
[,...] | ALL [ PRIVILEGES ] }
|
||||||
ON SEQUENCE <replaceable class="PARAMETER">sequencename</replaceable> [, ...]
|
ON SEQUENCE <replaceable class="PARAMETER">sequencename</replaceable> [, ...]
|
||||||
TO { <replaceable class="PARAMETER">username</replaceable> | GROUP <replaceable class="PARAMETER">groupname</replaceable> | PUBLIC } [, ...] [ WITH GRANT OPTION ]
|
TO { [ GROUP ] <replaceable class="PARAMETER">rolename</replaceable> | PUBLIC } [, ...] [ WITH GRANT OPTION ]
|
||||||
|
|
||||||
GRANT { { CREATE | CONNECT | TEMPORARY | TEMP } [,...] | ALL [ PRIVILEGES ] }
|
GRANT { { CREATE | CONNECT | TEMPORARY | TEMP } [,...] | ALL [ PRIVILEGES ] }
|
||||||
ON DATABASE <replaceable>dbname</replaceable> [, ...]
|
ON DATABASE <replaceable>dbname</replaceable> [, ...]
|
||||||
TO { <replaceable class="PARAMETER">username</replaceable> | GROUP <replaceable class="PARAMETER">groupname</replaceable> | PUBLIC } [, ...] [ WITH GRANT OPTION ]
|
TO { [ GROUP ] <replaceable class="PARAMETER">rolename</replaceable> | PUBLIC } [, ...] [ WITH GRANT OPTION ]
|
||||||
|
|
||||||
GRANT { EXECUTE | ALL [ PRIVILEGES ] }
|
GRANT { EXECUTE | ALL [ PRIVILEGES ] }
|
||||||
ON FUNCTION <replaceable>funcname</replaceable> ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] ) [, ...]
|
ON FUNCTION <replaceable>funcname</replaceable> ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] ) [, ...]
|
||||||
TO { <replaceable class="PARAMETER">username</replaceable> | GROUP <replaceable class="PARAMETER">groupname</replaceable> | PUBLIC } [, ...] [ WITH GRANT OPTION ]
|
TO { [ GROUP ] <replaceable class="PARAMETER">rolename</replaceable> | PUBLIC } [, ...] [ WITH GRANT OPTION ]
|
||||||
|
|
||||||
GRANT { USAGE | ALL [ PRIVILEGES ] }
|
GRANT { USAGE | ALL [ PRIVILEGES ] }
|
||||||
ON LANGUAGE <replaceable>langname</replaceable> [, ...]
|
ON LANGUAGE <replaceable>langname</replaceable> [, ...]
|
||||||
TO { <replaceable class="PARAMETER">username</replaceable> | GROUP <replaceable class="PARAMETER">groupname</replaceable> | PUBLIC } [, ...] [ WITH GRANT OPTION ]
|
TO { [ GROUP ] <replaceable class="PARAMETER">rolename</replaceable> | PUBLIC } [, ...] [ WITH GRANT OPTION ]
|
||||||
|
|
||||||
GRANT { { CREATE | USAGE } [,...] | ALL [ PRIVILEGES ] }
|
GRANT { { CREATE | USAGE } [,...] | ALL [ PRIVILEGES ] }
|
||||||
ON SCHEMA <replaceable>schemaname</replaceable> [, ...]
|
ON SCHEMA <replaceable>schemaname</replaceable> [, ...]
|
||||||
TO { <replaceable class="PARAMETER">username</replaceable> | GROUP <replaceable class="PARAMETER">groupname</replaceable> | PUBLIC } [, ...] [ WITH GRANT OPTION ]
|
TO { [ GROUP ] <replaceable class="PARAMETER">rolename</replaceable> | PUBLIC } [, ...] [ WITH GRANT OPTION ]
|
||||||
|
|
||||||
GRANT { CREATE | ALL [ PRIVILEGES ] }
|
GRANT { CREATE | ALL [ PRIVILEGES ] }
|
||||||
ON TABLESPACE <replaceable>tablespacename</> [, ...]
|
ON TABLESPACE <replaceable>tablespacename</> [, ...]
|
||||||
TO { <replaceable class="PARAMETER">username</replaceable> | GROUP <replaceable class="PARAMETER">groupname</replaceable> | PUBLIC } [, ...] [ WITH GRANT OPTION ]
|
TO { [ GROUP ] <replaceable class="PARAMETER">rolename</replaceable> | PUBLIC } [, ...] [ WITH GRANT OPTION ]
|
||||||
|
|
||||||
GRANT <replaceable class="PARAMETER">role</replaceable> [, ...] TO <replaceable class="PARAMETER">username</replaceable> [, ...] [ WITH ADMIN OPTION ]
|
GRANT <replaceable class="PARAMETER">role</replaceable> [, ...] TO <replaceable class="PARAMETER">rolename</replaceable> [, ...] [ WITH ADMIN OPTION ]
|
||||||
</synopsis>
|
</synopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
@ -405,18 +405,16 @@ GRANT <replaceable class="PARAMETER">role</replaceable> [, ...] TO <replaceable
|
|||||||
to obtain information about existing privileges, for example:
|
to obtain information about existing privileges, for example:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
=> \z mytable
|
=> \z mytable
|
||||||
|
Access privileges for database "lusitania"
|
||||||
Access privileges for database "lusitania"
|
Schema | Name | Type | Access privileges
|
||||||
Schema | Name | Type | Access privileges
|
--------+---------+-------+---------------------------------------------------
|
||||||
--------+---------+-------+-----------------------------------------------------------
|
public | mytable | table | {miriam=arwdxt/miriam,=r/miriam,admin=arw/miriam}
|
||||||
public | mytable | table | {miriam=arwdxt/miriam,=r/miriam,"group todos=arw/miriam"}
|
|
||||||
(1 row)
|
(1 row)
|
||||||
</programlisting>
|
</programlisting>
|
||||||
The entries shown by <command>\z</command> are interpreted thus:
|
The entries shown by <command>\z</command> are interpreted thus:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
|
rolename=xxxx -- privileges granted to a role
|
||||||
=xxxx -- privileges granted to PUBLIC
|
=xxxx -- privileges granted to PUBLIC
|
||||||
uname=xxxx -- privileges granted to a user
|
|
||||||
group gname=xxxx -- privileges granted to a group
|
|
||||||
|
|
||||||
r -- SELECT ("read")
|
r -- SELECT ("read")
|
||||||
w -- UPDATE ("write")
|
w -- UPDATE ("write")
|
||||||
@ -432,7 +430,7 @@ GRANT <replaceable class="PARAMETER">role</replaceable> [, ...] TO <replaceable
|
|||||||
arwdxt -- ALL PRIVILEGES (for tables)
|
arwdxt -- ALL PRIVILEGES (for tables)
|
||||||
* -- grant option for preceding privilege
|
* -- grant option for preceding privilege
|
||||||
|
|
||||||
/yyyy -- user who granted this privilege
|
/yyyy -- role that granted this privilege
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
The above example display would be seen by user <literal>miriam</> after
|
The above example display would be seen by user <literal>miriam</> after
|
||||||
@ -440,20 +438,20 @@ GRANT <replaceable class="PARAMETER">role</replaceable> [, ...] TO <replaceable
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
GRANT SELECT ON mytable TO PUBLIC;
|
GRANT SELECT ON mytable TO PUBLIC;
|
||||||
GRANT SELECT, UPDATE, INSERT ON mytable TO GROUP todos;
|
GRANT SELECT, UPDATE, INSERT ON mytable TO admin;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
If the <quote>Access privileges</> column is empty for a given object,
|
If the <quote>Access privileges</> column is empty for a given object,
|
||||||
it means the object has default privileges (that is, its privileges column
|
it means the object has default privileges (that is, its privileges column
|
||||||
is null). Default privileges always include all privileges for the owner,
|
is null). Default privileges always include all privileges for the owner,
|
||||||
and can include some privileges for <literal>PUBLIC</> depending on the
|
and can include some privileges for <literal>PUBLIC</> depending on the
|
||||||
object type, as explained above. The first <command>GRANT</> or
|
object type, as explained above. The first <command>GRANT</> or
|
||||||
<command>REVOKE</> on an object
|
<command>REVOKE</> on an object
|
||||||
will instantiate the default privileges (producing, for example,
|
will instantiate the default privileges (producing, for example,
|
||||||
<literal>{miriam=arwdxt/miriam}</>) and then modify them per the
|
<literal>{miriam=arwdxt/miriam}</>) and then modify them per the
|
||||||
specified request.
|
specified request.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$PostgreSQL: pgsql/doc/src/sgml/ref/revoke.sgml,v 1.45 2007/10/10 21:38:51 neilc Exp $
|
$PostgreSQL: pgsql/doc/src/sgml/ref/revoke.sgml,v 1.46 2007/10/30 19:43:30 tgl Exp $
|
||||||
PostgreSQL documentation
|
PostgreSQL documentation
|
||||||
-->
|
-->
|
||||||
|
|
||||||
@ -24,48 +24,48 @@ REVOKE [ GRANT OPTION FOR ]
|
|||||||
{ { SELECT | INSERT | UPDATE | DELETE | REFERENCES | TRIGGER }
|
{ { SELECT | INSERT | UPDATE | DELETE | REFERENCES | TRIGGER }
|
||||||
[,...] | ALL [ PRIVILEGES ] }
|
[,...] | ALL [ PRIVILEGES ] }
|
||||||
ON [ TABLE ] <replaceable class="PARAMETER">tablename</replaceable> [, ...]
|
ON [ TABLE ] <replaceable class="PARAMETER">tablename</replaceable> [, ...]
|
||||||
FROM { <replaceable class="PARAMETER">username</replaceable> | GROUP <replaceable class="PARAMETER">groupname</replaceable> | PUBLIC } [, ...]
|
FROM { [ GROUP ] <replaceable class="PARAMETER">rolename</replaceable> | PUBLIC } [, ...]
|
||||||
[ CASCADE | RESTRICT ]
|
[ CASCADE | RESTRICT ]
|
||||||
|
|
||||||
REVOKE [ GRANT OPTION FOR ]
|
REVOKE [ GRANT OPTION FOR ]
|
||||||
{ { USAGE | SELECT | UPDATE }
|
{ { USAGE | SELECT | UPDATE }
|
||||||
[,...] | ALL [ PRIVILEGES ] }
|
[,...] | ALL [ PRIVILEGES ] }
|
||||||
ON SEQUENCE <replaceable class="PARAMETER">sequencename</replaceable> [, ...]
|
ON SEQUENCE <replaceable class="PARAMETER">sequencename</replaceable> [, ...]
|
||||||
FROM { <replaceable class="PARAMETER">username</replaceable> | GROUP <replaceable class="PARAMETER">groupname</replaceable> | PUBLIC } [, ...]
|
FROM { [ GROUP ] <replaceable class="PARAMETER">rolename</replaceable> | PUBLIC } [, ...]
|
||||||
[ CASCADE | RESTRICT ]
|
[ CASCADE | RESTRICT ]
|
||||||
|
|
||||||
REVOKE [ GRANT OPTION FOR ]
|
REVOKE [ GRANT OPTION FOR ]
|
||||||
{ { CREATE | CONNECT | TEMPORARY | TEMP } [,...] | ALL [ PRIVILEGES ] }
|
{ { CREATE | CONNECT | TEMPORARY | TEMP } [,...] | ALL [ PRIVILEGES ] }
|
||||||
ON DATABASE <replaceable>dbname</replaceable> [, ...]
|
ON DATABASE <replaceable>dbname</replaceable> [, ...]
|
||||||
FROM { <replaceable class="PARAMETER">username</replaceable> | GROUP <replaceable class="PARAMETER">groupname</replaceable> | PUBLIC } [, ...]
|
FROM { [ GROUP ] <replaceable class="PARAMETER">rolename</replaceable> | PUBLIC } [, ...]
|
||||||
[ CASCADE | RESTRICT ]
|
[ CASCADE | RESTRICT ]
|
||||||
|
|
||||||
REVOKE [ GRANT OPTION FOR ]
|
REVOKE [ GRANT OPTION FOR ]
|
||||||
{ EXECUTE | ALL [ PRIVILEGES ] }
|
{ EXECUTE | ALL [ PRIVILEGES ] }
|
||||||
ON FUNCTION <replaceable>funcname</replaceable> ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] ) [, ...]
|
ON FUNCTION <replaceable>funcname</replaceable> ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] ) [, ...]
|
||||||
FROM { <replaceable class="PARAMETER">username</replaceable> | GROUP <replaceable class="PARAMETER">groupname</replaceable> | PUBLIC } [, ...]
|
FROM { [ GROUP ] <replaceable class="PARAMETER">rolename</replaceable> | PUBLIC } [, ...]
|
||||||
[ CASCADE | RESTRICT ]
|
[ CASCADE | RESTRICT ]
|
||||||
|
|
||||||
REVOKE [ GRANT OPTION FOR ]
|
REVOKE [ GRANT OPTION FOR ]
|
||||||
{ USAGE | ALL [ PRIVILEGES ] }
|
{ USAGE | ALL [ PRIVILEGES ] }
|
||||||
ON LANGUAGE <replaceable>langname</replaceable> [, ...]
|
ON LANGUAGE <replaceable>langname</replaceable> [, ...]
|
||||||
FROM { <replaceable class="PARAMETER">username</replaceable> | GROUP <replaceable class="PARAMETER">groupname</replaceable> | PUBLIC } [, ...]
|
FROM { [ GROUP ] <replaceable class="PARAMETER">rolename</replaceable> | PUBLIC } [, ...]
|
||||||
[ CASCADE | RESTRICT ]
|
[ CASCADE | RESTRICT ]
|
||||||
|
|
||||||
REVOKE [ GRANT OPTION FOR ]
|
REVOKE [ GRANT OPTION FOR ]
|
||||||
{ { CREATE | USAGE } [,...] | ALL [ PRIVILEGES ] }
|
{ { CREATE | USAGE } [,...] | ALL [ PRIVILEGES ] }
|
||||||
ON SCHEMA <replaceable>schemaname</replaceable> [, ...]
|
ON SCHEMA <replaceable>schemaname</replaceable> [, ...]
|
||||||
FROM { <replaceable class="PARAMETER">username</replaceable> | GROUP <replaceable class="PARAMETER">groupname</replaceable> | PUBLIC } [, ...]
|
FROM { [ GROUP ] <replaceable class="PARAMETER">rolename</replaceable> | PUBLIC } [, ...]
|
||||||
[ CASCADE | RESTRICT ]
|
[ CASCADE | RESTRICT ]
|
||||||
|
|
||||||
REVOKE [ GRANT OPTION FOR ]
|
REVOKE [ GRANT OPTION FOR ]
|
||||||
{ CREATE | ALL [ PRIVILEGES ] }
|
{ CREATE | ALL [ PRIVILEGES ] }
|
||||||
ON TABLESPACE <replaceable>tablespacename</replaceable> [, ...]
|
ON TABLESPACE <replaceable>tablespacename</replaceable> [, ...]
|
||||||
FROM { <replaceable class="PARAMETER">username</replaceable> | GROUP <replaceable class="PARAMETER">groupname</replaceable> | PUBLIC } [, ...]
|
FROM { [ GROUP ] <replaceable class="PARAMETER">rolename</replaceable> | PUBLIC } [, ...]
|
||||||
[ CASCADE | RESTRICT ]
|
[ CASCADE | RESTRICT ]
|
||||||
|
|
||||||
REVOKE [ ADMIN OPTION FOR ]
|
REVOKE [ ADMIN OPTION FOR ]
|
||||||
<replaceable class="PARAMETER">role</replaceable> [, ...] FROM <replaceable class="PARAMETER">username</replaceable> [, ...]
|
<replaceable class="PARAMETER">role</replaceable> [, ...] FROM <replaceable class="PARAMETER">rolename</replaceable> [, ...]
|
||||||
[ CASCADE | RESTRICT ]
|
[ CASCADE | RESTRICT ]
|
||||||
</synopsis>
|
</synopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
@ -107,7 +107,7 @@ REVOKE [ ADMIN OPTION FOR ]
|
|||||||
called dependent privileges. If the privilege or the grant option
|
called dependent privileges. If the privilege or the grant option
|
||||||
held by the first user is being revoked and dependent privileges
|
held by the first user is being revoked and dependent privileges
|
||||||
exist, those dependent privileges are also revoked if
|
exist, those dependent privileges are also revoked if
|
||||||
<literal>CASCADE</literal> is specified, else the revoke action
|
<literal>CASCADE</literal> is specified; if it is not, the revoke action
|
||||||
will fail. This recursive revocation only affects privileges that
|
will fail. This recursive revocation only affects privileges that
|
||||||
were granted through a chain of users that is traceable to the user
|
were granted through a chain of users that is traceable to the user
|
||||||
that is the subject of this <literal>REVOKE</literal> command.
|
that is the subject of this <literal>REVOKE</literal> command.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user