Provided by: manpages-zh_1.5.2-1_all bug

NAME

       GRANT -

SYNOPSIS

       GRANT { { SELECT | INSERT | UPDATE | DELETE | RULE | REFERENCES | TRIGGER }
           [,...] | ALL [ PRIVILEGES ] }
           ON [ TABLE ] tablename [, ...]
           TO { username | GROUP groupname | PUBLIC } [, ...] [ WITH GRANT OPTION ]

       GRANT { { CREATE | TEMPORARY | TEMP } [,...] | ALL [ PRIVILEGES ] }
           ON DATABASE dbname [, ...]
           TO { username | GROUP groupname | PUBLIC } [, ...] [ WITH GRANT OPTION ]

       GRANT { EXECUTE | ALL [ PRIVILEGES ] }
           ON FUNCTION funcname ([type, ...]) [, ...]
           TO { username | GROUP groupname | PUBLIC } [, ...] [ WITH GRANT OPTION ]

       GRANT { USAGE | ALL [ PRIVILEGES ] }
           ON LANGUAGE langname [, ...]
           TO { username | GROUP groupname | PUBLIC } [, ...] [ WITH GRANT OPTION ]

       GRANT { { CREATE | USAGE } [,...] | ALL [ PRIVILEGES ] }
           ON SCHEMA schemaname [, ...]
           TO { username | GROUP groupname | PUBLIC } [, ...] [ WITH GRANT OPTION ]

DESCRIPTION

       GRANT

         PUBLIC , PUBLIC   //  PUBLIC

         WITH GRANT OPTION  PUBLIC

         PUBLIC   TEMP EXECUTE   USAGE   REVOKE

       SELECT
                SELECT [select(7)] COPY [copy(7)] TO   currval

       INSERT
                INSERT [insert(7)]   COPY [copy(7)] FROM

       UPDATE
                 UPDATE  [update(7)]   SELECT ... FOR UPDATE   SELECT  nextval
              setval

       DELETE
                DELETE [delete(7)]

       RULE
               / CREATE RULE [create_rule(7)]

       REFERENCES

       TRIGGER
                CREATE TRIGGER [create_trigger(7)]

       CREATE

       TEMPORARY

       TEMP

       EXECUTE

       USAGE

                ""

       ALL PRIVILEGES
                PRIVILEGES  PostgreSQL   SQL

NOTES

       REVOKE [revoke(7)]

          Unix  root   root

       If a superuser chooses to issue a GRANT or REVOKE command, the  command
       is  performed  as  though  it  were issued by the owner of the affected
       object. In particular, privileges  granted  via  such  a  command  will
       appear to have been granted by the object owner.

         PostgreSQL

         psql(1)  \z

       => \z mytable

               Access privileges for database "lusitania"
        Schema |  Table  |           Access privileges
       --------+---------+---------------------------------------
        public | mytable | {=r/postgres,miriam=arwdRxt/postgres,"group todos=arw/postgres"}
       (1 row)

       \z

                     =xxxx --  PUBLIC
                uname=xxxx --
          group gname=xxxx --

                         r -- SELECT ("")
                         w -- UPDATE ("")
                         a -- INSERT ("")
                         d -- DELETE
                         R -- RULE
                         x -- REFERENCES
                         t -- TRIGGER
                         X -- EXECUTE
                         U -- USAGE
                         C -- CREATE
                         T -- TEMPORARY
                   arwdRxt -- ALL PRIVILEGES (for tables)
                         * --

                     /yyyy --

         miriam

       GRANT SELECT ON mytable TO PUBLIC;
       GRANT SELECT, UPDATE, INSERT ON mytable TO GROUP todos;

            "Access    privileges"      NULL     PUBLIC       GRANT     REVOKE
       {=,miriam=arwdRxt}

EXAMPLES

         films

       GRANT INSERT ON films TO PUBLIC;

        manuelkinds

       GRANT ALL PRIVILEGES ON kinds TO manuel;

COMPATIBILITY

         SQL  ALL PRIVILEGES  PRIVILEGES  SQL

       SQL

       GRANT privileges
           ON table [ ( column [, ...] ) ] [, ...]
           TO { PUBLIC | username [, ...] } [ WITH GRANT OPTION ]

       SQL  USAGE

       RULE  PostgreSQL

SEE ALSO

       REVOKE [revoke(7)]

       Postgresql  <laser@pgsqldb.org>