From eebfb9baa517b2680cf963b74e4c6a9fb12a1df2 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Tue, 30 Nov 1999 03:57:29 +0000 Subject: create/alter user extension MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This one should work much better than the one I sent in previously. The functionality is the same, but the patch was missing one file resulting in the compilation failing. The docs also received a minor fix. Peter Eisentraut Sernanders väg 10:115 --- doc/src/sgml/ref/alter_user.sgml | 31 +++++++++++----- doc/src/sgml/ref/create_user.sgml | 74 ++++++++++++++++++--------------------- 2 files changed, 58 insertions(+), 47 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/alter_user.sgml b/doc/src/sgml/ref/alter_user.sgml index 686684632a5..75bcca86546 100644 --- a/doc/src/sgml/ref/alter_user.sgml +++ b/doc/src/sgml/ref/alter_user.sgml @@ -1,5 +1,5 @@ @@ -23,7 +23,10 @@ Postgres documentation 1999-07-20 -ALTER USER username [ WITH PASSWORD password ] +ALTER USER username + [ WITH + [ SYSID uid ] + [ PASSWORD password ] ] [ CREATEDB | NOCREATEDB ] [ CREATEUSER | NOCREATEUSER ] [ IN GROUP groupname [, ...] ] [ VALID UNTIL 'abstime' ] @@ -62,6 +65,22 @@ ALTER USER username [ WITH PASSWORD + + uid + + + The new PostgreSQL user id of the user. + Since this number is used as a key into the + pg_shadow/pg_user table + throughout the system catalogs, it is not recommended that you change + it unless the user in question does not own anything at all and/or + you really know what you are doing. Note that it is not necessary that + database and UNIX user ids match, but some people + choose to keep the numbers the same. + + + + groupname @@ -130,9 +149,7 @@ ERROR: alterUser: user "username" does not exist ALTER USER is used to change the attributes of a user's Postgres account. - Please note that it is not possible - to alter a user's "usesysid" via the alter user - statement. Also, it is only possible for the + Also, it is only possible for the Postgres user or any user with read and modify permissions on pg_shadow to alter user passwords. @@ -161,9 +178,7 @@ ERROR: alterUser: user "username" does not exist to create or remove a user account. - In the current release (v6.5), the IN GROUP clause is parsed - but has no affect. When it is fully implemented, it is - intended to modify the pg_group relation. + The IN GROUP clause is not yet implemented. diff --git a/doc/src/sgml/ref/create_user.sgml b/doc/src/sgml/ref/create_user.sgml index b7a55d05d48..9eccd3f7130 100644 --- a/doc/src/sgml/ref/create_user.sgml +++ b/doc/src/sgml/ref/create_user.sgml @@ -1,5 +1,5 @@ @@ -23,8 +23,10 @@ Postgres documentation 1999-07-20 -CREATE USER username - [ WITH PASSWORD password ] +CREATE USER username + [ WITH + [ SYSID uid ] + [ PASSWORD password ] ] [ CREATEDB | NOCREATEDB ] [ CREATEUSER | NOCREATEUSER ] [ IN GROUP groupname [, ...] ] [ VALID UNTIL 'abstime' ] @@ -49,11 +51,28 @@ CREATE USER username + + uid + + + The SYSID clause can be used to choose + the PostgreSQL user id of the user + that is being created. It is not at all necessary that those + match the UNIX user ids, but some people + choose to keep the numbers the same. + + + If this is not specified, the highest assigned user id plus one + will be used as default. + + + + password - The WITH PASSWORD clause sets the user's password within + The PASSWORD clause sets the user's password within the "pg_shadow" table. For this reason, "pg_shadow" is no longer accessible to the instance of @@ -173,30 +192,9 @@ CREATE USER CREATE USER will add a new user to an instance of - Postgres. + PostgreSQL. - - The new user will be given a usesysid of: - - -SELECT MAX(usesysid) + 1 FROM pg_shadow; - - - This means that - Postgres users' usesysids will not - correspond to their operating - system(OS) user ids. The exception to this rule is - the postgres superuser, whose OS user id - is used as the - usesysid during the initdb process. - If you still want the - OS user id and the usesysid to match - for any given user, - use the createuser script provided with - the Postgres distribution. - - 1998-09-21 @@ -216,19 +214,17 @@ SELECT MAX(usesysid) + 1 FROM pg_shadow; Refer to the pg_shadow table for further information. - Table = pg_shadow - +--------------------------+--------------------------+-------+ - | Field | Type | Length| - +--------------------------+--------------------------+-------+ - | usename | name | 32 | - | usesysid | int4 | 4 | - | usecreatedb | bool | 1 | - | usetrace | bool | 1 | - | usesuper | bool | 1 | - | usecatupd | bool | 1 | - | passwd | text | var | - | valuntil | abstime | 4 | - +--------------------------+--------------------------+-------+ + Table "pg_shadow" + Attribute | Type | Extra +-------------+---------+------- + usename | name | + usesysid | int4 | + usecreatedb | bool | + usetrace | bool | + usesuper | bool | + usecatupd | bool | + passwd | text | + valuntil | abstime | -- cgit v1.2.3