Computer Science


REVOKE(l)                                               REVOKE(l)

NAME
       REVOKE  - Revokes access privilege from a user, a group or
       all users.

SYNOPSIS
       REVOKE privilege [, ...]
           ON object [, ...]
           FROM { PUBLIC | GROUP ER">gBLE> | username }

   INPUTS
       privilege
              The possible privileges are:

              SELECT Privilege to access all of the columns of  a
                     specific table/view.

              INSERT Privilege to insert data into all columns of
                     a specific table.

              UPDATE Privilege to update all columns  of  a  spe-
                     cific table.

              DELETE Privilege  to  delete  rows  from a specific
                     table.

              RULE   Privilege to  define  rules  on  table/view.
                     (See create_rule(l)).

              ALL    Rescind all privileges.

       object The  name of an object from which to revoke access.
              The possible objects are:

              o table

              o view

              o sequence

              o index

       group  The name of a group from whom to revoke privileges.

       username
              The name of a user from whom revoke privileges. Use
              the PUBLIC keyword to specify all users.

       PUBLIC Rescind the specified privilege(s) for all users.

   OUTPUTS
       CHANGE Message returned if successfully.

       ERROR  Message returned if  object  is  not  available  or
              impossible  to  revoke  privileges  from a group or
              users.

DESCRIPTION
       REVOKE allows creator of an object to  revoke  permissions
       granted  before,  from all users (via PUBLIC) or a certain
       user or group.

   NOTES
       Refer to psql \z command  for  further  information  about
       permissions on existing objects:

       Database    = lusitania
       +------------------+---------------------------------------------+
       |  Relation        |        Grant/Revoke Permissions             |
       +------------------+---------------------------------------------+
       | mytable          | {"=rw","miriam=arwR","group todos=rw"}      |
       +------------------+---------------------------------------------+
       Legend:
            uname=arwR -- privileges granted to a user
            group gname=arwR -- privileges granted to a GROUP
            =arwR -- privileges granted to PUBLIC

            r -- SELECT
            w -- UPDATE/DELETE
            a -- INSERT
            R -- RULE
            arwR -- ALL

              Tip:  Currently,  to  create  a  GROUP  you have to
              insert data manually into table pg_group as:

              INSERT INTO pg_group VALUES ('todos');
              CREATE USER miriam IN GROUP todos;

USAGE
       Revoke insert privilege from all users on table films:

       REVOKE INSERT ON films FROM PUBLIC;

       Revoke all privileges from user manuel on view kinds:

       REVOKE ALL ON kinds FROM manuel;

COMPATIBILITY
   SQL92
       The SQL92 syntax for REVOKE  has  additional  capabilities
       for  rescinding  privileges, including those on individual
       columns in tables:

       Refer to
              grant(l) for details on individual fields.

       Rescinds authority for a user to grant the specified priv-
              ilege
              to  others.  Refer to grant(l) for details on indi-
              vidual fields.

       The possible objects are:

       [ TABLE ] table/view

       CHARACTER SET character-set

       COLLATION collation

       TRANSLATION translation

       DOMAIN domain

       If user1 gives a privilege WITH GRANT OPTION to user2, and
       user2  gives it to user3 then user1 can revoke this privi-
       lege in cascade using the CASCADE keyword.

       If user1 gives a privilege WITH GRANT OPTION to user2, and
       user2  gives  it  to  user3  then if user1 try revoke this
       privilege it fails if he/she specify the RESTRICT keyword.

SQL - Language Statements 15 August 1999                        1

Back to the index


Apply now!


Handbook

Postgraduate study options

Computer Science Blog



Please give us your feedback or ask us a question

This message is...


My feedback or question is...


My email address is...

(Only if you need a reply)

A to Z Directory | Site map | Accessibility | Copyright | Privacy | Disclaimer | Feedback on this page