From 58d214e51fe50b10b4439da6ec263d54c155afbf Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 26 Jul 2005 23:24:02 +0000 Subject: Basic documentation for ROLEs. The user-manag chapter still needs to be rewritten, but at least the reference pages are reasonably sane. --- doc/src/sgml/ref/create_user.sgml | 218 ++++---------------------------------- 1 file changed, 22 insertions(+), 196 deletions(-) (limited to 'doc/src/sgml/ref/create_user.sgml') diff --git a/doc/src/sgml/ref/create_user.sgml b/doc/src/sgml/ref/create_user.sgml index ed15c410a61..68d37bbd86d 100644 --- a/doc/src/sgml/ref/create_user.sgml +++ b/doc/src/sgml/ref/create_user.sgml @@ -1,5 +1,5 @@ @@ -11,7 +11,7 @@ PostgreSQL documentation CREATE USER - define a new database user account + define a new database role @@ -24,12 +24,20 @@ CREATE USER name [ [ WITH ] option can be: - SYSID uid + SUPERUSER | NOSUPERUSER | CREATEDB | NOCREATEDB + | CREATEROLE | NOCREATEROLE | CREATEUSER | NOCREATEUSER - | IN GROUP groupname [, ...] + | INHERIT | NOINHERIT + | LOGIN | NOLOGIN | [ ENCRYPTED | UNENCRYPTED ] PASSWORD 'password' - | VALID UNTIL 'abstime' + | VALID UNTIL 'timestamp' + | IN ROLE rolename [, ...] + | IN GROUP rolename [, ...] + | ROLE rolename [, ...] + | ADMIN rolename [, ...] + | USER rolename [, ...] + | SYSID uid @@ -37,194 +45,14 @@ where option can be: Description - CREATE USER adds a new user to a - PostgreSQL database cluster. Refer to - and for information about managing - users and authentication. You must be a database superuser to use - this command. - - - - - Parameters - - - - name - - - The name of the new user. - - - - - - uid - - - The SYSID clause can be used to choose the - PostgreSQL user ID of the new user. - This is normally not necessary, but may - be useful if you need to recreate the owner of an orphaned - object. - - - If this is not specified, the highest assigned user ID plus one - (with a minimum of 100) will be used as default. - - - - - - CREATEDB - NOCREATEDB - - - These clauses define a user's ability to create databases. If - CREATEDB is specified, the user being - defined will be allowed to create his own databases. Using - NOCREATEDB will deny a user the ability to - create databases. If not specified, - NOCREATEDB is the default. - - - - - - CREATEUSER - NOCREATEUSER - - - These clauses determine whether a user will be permitted to - create new users himself. CREATEUSER will also make - the user a superuser, who can override all access restrictions. - If not specified, - NOCREATEUSER is the default. - - - - - - groupname - - - A name of an existing group into which to insert the user as a new - member. Multiple group names may be listed. - - - - - - password - - - Sets the user's password. If you do not plan to use password - authentication you can omit this option, but then the user - won't be able to connect if you decide to switch to password - authentication. The password can be set or changed later, - using . - - - - - - ENCRYPTED - UNENCRYPTED - - - These key words control whether the password is stored - encrypted in the system catalogs. (If neither is specified, - the default behavior is determined by the configuration - parameter .) If the - presented password string is already in MD5-encrypted format, - then it is stored encrypted as-is, regardless of whether - ENCRYPTED or UNENCRYPTED is specified - (since the system cannot decrypt the specified encrypted - password string). This allows reloading of encrypted - passwords during dump/restore. - - - - Note that older clients may lack support for the MD5 - authentication mechanism that is needed to work with passwords - that are stored encrypted. - - - - - - abstime - - - The VALID UNTIL clause sets an absolute - time after which the user's password is no longer valid. If - this clause is omitted the password will be valid for all time. - - - - - - - - Notes - - - Use to - change the attributes of a user, and to remove a user. Use to add the - user to groups or remove the user from groups. - - - - PostgreSQL includes a program that has - the same functionality as CREATE USER (in fact, it calls this - command) but can be run from the command shell. - - - - The VALID UNTIL clause defines an expiration time for a - password only, not for the user account per se. In - particular, the expiration time is not enforced when logging in using - a non-password-based authentication method. - - - - - Examples - - - Create a user with no password: - -CREATE USER jonathan; - - - - - Create a user with a password: - -CREATE USER davide WITH PASSWORD 'jw8s0F4'; - - - - - Create a user with a password that is valid until the end of 2004. - After one second has ticked in 2005, the password is no longer - valid. - - -CREATE USER miriam WITH PASSWORD 'jw8s0F4' VALID UNTIL '2005-01-01'; - - - - - Create an account where the user can create databases: - -CREATE USER manuel WITH PASSWORD 'jw8s0F4' CREATEDB; - + CREATE USER is now an alias for + , + which see for more information. + The only difference is that when the command is spelled + CREATE USER, LOGIN is assumed + by default, whereas NOLOGIN is assumed when + the command is spelled + CREATE ROLE. @@ -242,9 +70,7 @@ CREATE USER manuel WITH PASSWORD 'jw8s0F4' CREATEDB; See Also - - - + -- cgit v1.2.3