2 $Header: /cvsroot/pgsql/doc/src/sgml/ref/revoke.sgml,v 1.19 2001/12/08 03:24:39 thomas Exp $
3 PostgreSQL documentation
6 <refentry id="SQL-REVOKE">
8 <refentrytitle id="sql-revoke-title">REVOKE</refentrytitle>
9 <refmiscinfo>SQL - Language Statements</refmiscinfo>
13 <refname>REVOKE</refname>
14 <refpurpose>remove access privileges</refpurpose>
19 REVOKE { { SELECT | INSERT | UPDATE | DELETE | RULE | REFERENCES | TRIGGER } [,...] | ALL [ PRIVILEGES ] }
20 ON [ TABLE ] <replaceable class="PARAMETER">object</replaceable> [, ...]
21 FROM { <replaceable class="PARAMETER">username</replaceable> | GROUP <replaceable class="PARAMETER">groupname</replaceable> | PUBLIC } [, ...]
25 <refsect1 id="SQL-REVOKE-description">
26 <title>Description</title>
29 <command>REVOKE</command> allows the creator of an object to revoke
30 previously granted permissions from one or more users or groups of users.
31 The key word <literal>PUBLIC</literal> refers to the implicitly defined
36 Note that any particular user will have the sum
37 of privileges granted directly to him, privileges granted to any group he
38 is presently a member of, and privileges granted to
39 <literal>PUBLIC</literal>. Thus, for example, revoking SELECT privilege
40 from <literal>PUBLIC</literal> does not necessarily mean that all users
41 have lost SELECT privilege on the object: those who have it granted
42 directly or via a group will still have it.
46 See the description of the <xref linkend="sql-grant" endterm="sql-grant-title"> command for
47 the meaning of the privilege types.
51 <refsect1 id="SQL-REVOKE-notes">
55 Use <xref linkend="app-psql">'s <command>\z</command> command to
56 display the privileges granted on existing objects. See also <xref
57 linkend="sql-grant"> for information about the format.
61 <refsect1 id="SQL-REVOKE-examples">
62 <title>Examples</title>
65 Revoke insert privilege for the public on table
66 <literal>films</literal>:
69 REVOKE INSERT ON films FROM PUBLIC;
74 Revoke all privileges from user <literal>manuel</literal> on view <literal>kinds</literal>:
77 REVOKE ALL PRIVILEGES ON kinds FROM manuel;
82 <refsect1 id="SQL-REVOKE-compatibility">
83 <title>Compatibility</title>
89 The compatibility notes of the <xref linkend="sql-grant" endterm="sql-grant-title"> command
90 apply analogously to <command>REVOKE</command>. The syntax summary is:
93 REVOKE [ GRANT OPTION FOR ] { SELECT | INSERT | UPDATE | DELETE | REFERENCES }
94 ON <replaceable class="parameter">object</replaceable> [ ( <replaceable class="parameter">column</replaceable> [, ...] ) ]
95 FROM { PUBLIC | <replaceable class="parameter">username</replaceable> [, ...] }
96 { RESTRICT | CASCADE }
101 If user1 gives a privilege WITH GRANT OPTION to user2,
102 and user2 gives it to user3 then user1 can revoke
103 this privilege in cascade using the CASCADE keyword.
104 If user1 gives a privilege WITH GRANT OPTION to user2,
105 and user2 gives it to user3, then if user1 tries to revoke
106 this privilege it fails if he specifies the RESTRICT
113 <title>See Also</title>
116 <xref linkend="sql-grant">
122 <!-- Keep this comment at the end of the file
127 sgml-minimize-attributes:nil
128 sgml-always-quote-attributes:t
131 sgml-parent-document:nil
132 sgml-default-dtd-file:"../reference.ced"
133 sgml-exposed-tags:nil
134 sgml-local-catalogs:"/usr/lib/sgml/catalog"
135 sgml-local-ecat-files:nil