From 6d3f74d80190eb8da873b06aec24966f5921766e Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 25 Mar 2005 16:38:58 +0000 Subject: [PATCH] Update and copy-edit description of privileges. --- doc/src/sgml/user-manag.sgml | 47 +++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/doc/src/sgml/user-manag.sgml b/doc/src/sgml/user-manag.sgml index f306b27ea0..5ffd878efd 100644 --- a/doc/src/sgml/user-manag.sgml +++ b/doc/src/sgml/user-manag.sgml @@ -1,5 +1,5 @@ @@ -260,42 +260,37 @@ SELECT groname FROM pg_group; When an object is created, it is assigned an owner. The - owner is the user that executed the creation statement. To change - the owner of a table, index, sequence, or view, use the - ALTER TABLE command. By default, only an owner - (or a superuser) can do anything with the object. In order to allow + owner is normally the user that executed the creation statement. + For most kinds of objects, the initial state is that only the owner + (or a superuser) can do anything with the object. To allow other users to use it, privileges must be granted. - - - - There are several different privileges: SELECT, + There are several different kinds of privilege: SELECT, INSERT, UPDATE, DELETE, RULE, REFERENCES, TRIGGER, CREATE, TEMPORARY, EXECUTE, - USAGE, and ALL PRIVILEGES. For more + and USAGE. For more information on the different types of privileges supported by PostgreSQL, see the reference page. - The right to modify or - destroy an object is always the privilege of the owner only. To - assign privileges, the GRANT command is + + + + To assign privileges, the GRANT command is used. So, if joe is an existing user, and accounts is an existing table, the privilege to update the table can be granted with - GRANT UPDATE ON accounts TO joe; - The user executing this command must be the owner of the table. To - grant a privilege to a group, use + To grant a privilege to a group, use GRANT SELECT ON accounts TO GROUP staff; - The special user name PUBLIC can + The special name PUBLIC can be used to grant a privilege to every user on the system. Writing ALL in place of a specific privilege specifies that all - privileges will be granted. + privileges that apply to the object will be granted. @@ -304,13 +299,21 @@ GRANT SELECT ON accounts TO GROUP staff; REVOKE ALL ON accounts FROM PUBLIC; - The special privileges of the table owner (i.e., the right to do - DROP, GRANT, REVOKE, etc) - are always implicit in being the owner, - and cannot be granted or revoked. But the table owner can choose + + + + The special privileges of an object's owner (i.e., the right to modify + or destroy the object) are always implicit in being the owner, + and cannot be granted or revoked. But the owner can choose to revoke his own ordinary privileges, for example to make a table read-only for himself as well as others. + + + An object can be assigned to a new owner with an ALTER + command of the appropriate kind for the object. Only superusers can do + this. +