next up previous contents index
Next: Inheritance Up: Table Management Previous: ALTER TABLE

     
GRANT and REVOKE

When a table is created, only its owner can access it. If the owner wants others to have access, he must change the table's permissions using the GRANT command. Figure [*] shows some examples of the use of GRANT.  

        test=> CREATE TABLE permtest (col INTEGER);
        CREATE
        test=> -- now only the owner can use permtest
        test->
        test=> GRANT SELECT ON permtest TO meyers;
        CHANGE
        test=> -- now user 'meyers' can do SELECTs on permtest
        test=>
        test=> GRANT ALL ON permtest TO PUBLIC;  
        CHANGE
        test=> -- now all users can perform all operations on permtest
        test=>
 

Available privileges are SELECT , UPDATE , DELETE , RULE , and ALL.  Access can be granted to individual users, groups, or everyone (PUBLIC). The rules for granting access are covered in Section [*].

REVOKE removes permissions from a table. See the GRANT and REVOKE manual pages for more information.    


Bruce Momjian
2001-05-09