Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit594aae9

Browse files
committed
From: todd brandys <brandys@eng3.hep.uiuc.edu>
o The manual (really text) pages for create/alter/drop user.
1 parent674b22a commit594aae9

File tree

3 files changed

+170
-0
lines changed

3 files changed

+170
-0
lines changed

‎src/man/alter_user.l

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
.\" This is -*-nroff-*-
2+
.\" XXX standard disclaimer belongs here....
3+
.\" $Header: /cvsroot/pgsql/src/man/Attic/alter_user.l,v 1.1 1998/01/25 07:42:00 scrappy Exp $
4+
.TH "ALTER USER" SQL 01/26/98 PostgreSQL PostgreSQL
5+
.SH NAME
6+
alter user -- alter user account information within a PostgreSQL instance
7+
.SH SYNOPSIS
8+
.nf
9+
\fBalteruser\fR username
10+
[\fBwithpassword\fR password]
11+
[\fBcreatedb\fR |\fBnocreatedb\fR]
12+
[\fBcreateuser\fR |\fBnocreateuser\fR]
13+
[\fBingroup\fR group-1, ..., group-n]
14+
[\fBvaliduntil'\fRabstime\fB'\fR]
15+
.fi
16+
.SH DESCRIPTION
17+
.BR"alter user"
18+
is used to change the attributes of a user's PostgreSQL account. For a
19+
detailed description of each of the clause in the alter user statement,
20+
please see the create_user(l) manual page. Please note that it is not
21+
possible to alter a user's usesysid via the alter user statement. Also,
22+
it is only possible for the postgres user or any user with read and modify
23+
permissions on pg_user to alter user passwords.
24+
25+
If any of the clauses of the alter user statement are omitted, the
26+
corresponding value in the pg_user relation is left unchanged.
27+
28+
This statement can be used to modify users created with createuser(1).
29+
30+
.SH EXAMPLES
31+
.nf
32+
---
33+
--- Change a user password
34+
---
35+
alter user tab with password hu8jmn3;
36+
.fi
37+
.nf
38+
---
39+
--- Change a user's valid until date
40+
---
41+
alter user tab valid until 'Jan 31 2030';
42+
.fi
43+
.nf
44+
---
45+
--- Give a user the ability to create other users.
46+
---
47+
alter user tab createuser;
48+
.fi
49+
.SH "SEE ALSO"
50+
create_user(l), drop_user(l).

‎src/man/create_user.l

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
.\" This is -*-nroff-*-
2+
.\" XXX standard disclaimer belongs here....
3+
.\" $Header: /cvsroot/pgsql/src/man/Attic/create_user.l,v 1.1 1998/01/25 07:42:01 scrappy Exp $
4+
.TH "CREATE USER" SQL 01/26/98 PostgreSQL PostgreSQL
5+
.SH NAME
6+
create user -- create a new user within a PostgreSQL instance
7+
.SH SYNOPSIS
8+
.nf
9+
\fBcreateuser<username>
10+
[\fBwithpassword\fR password]
11+
[\fBcreatedb\fR |\fBnocreatedb\fR]
12+
[\fBcreateuser\fR |\fBnocreateuser\fR]
13+
[\fBingroup\fR group-1, ..., group-n]
14+
[\fBvaliduntil'\fRabstime\fB'\fR]
15+
.fi
16+
.SH DESCRIPTION
17+
.BR"create user"
18+
will add a new user to an instance of PostgreSQL. The new user will be
19+
given a usesysid of 'SELECT max(usesysid) + 1 FROM pg_user'. This means
20+
that a PostgreSQL user's usesysid will not correspond to their operating
21+
system(OS) user id. The exception to this rule is the 'postgres' user,
22+
whose OS user id is used as the usesysid during the initdb process. If
23+
you still want the OS user id and the usesysid to match for any given
24+
user, then use the createuser(1) script provided with the PostgreSQL
25+
distribution.
26+
27+
The 'with password' clause sets the user's password within the pg_user
28+
relation. For this reason, pg_user is no longer accessible to the
29+
'public'group.Pleasenotethatwheninitdb(1)isexecutedforan
30+
instance of PostgreSQL that the postgres user's password is initially set
31+
to NULL. When a user's password in the pg_user relation is NULL, then
32+
user authentication proceeds as it historically has (HBA, PG_PASSWORD,
33+
etc). However, if a password is set for a user, then a new authentication
34+
system supplants any other configured for the PostgreSQL instance, and the
35+
password stored in the pg_user relation is used for authentication. For
36+
more details on how this authentication system functions see pg_crypt(3).
37+
If the 'with password' clause is omitted, then the user's password is set
38+
to the empty string with equates to a NULL value in the authentication
39+
system mentioned above.
40+
41+
The createdb/nocreatedb clause defines a user's ability to create
42+
databases. If createdb is specified, then the user being defined will be
43+
allowed to create his/her own databases. Using nocreatedb will deny a
44+
user the ability to create databases. If this clause is omitted, then
45+
nocreatedb is used by default.
46+
47+
The createuser/nocreateuser clause allows/prevents a user from creating
48+
new users in an instance of PostgreSQL. Omitting this clause will set the
49+
user's value of this attribute to be nocreateuser.
50+
51+
At the current time the 'in group' clause is non-functional. The intent
52+
is to use this clause to affect the groups a user is a member of (as
53+
defined in the pg_group relation).
54+
55+
Finally, the 'valid until' clause sets an absolute time after which the
56+
user's PostgreSQL login is no longer valid. Please note that if a user
57+
does not have a password defined in the pg_user relation, then the valid
58+
until date will not be checked during user authentication. If this clause
59+
is omitted, then a NULL value is stored in pg_user for this attribute, and
60+
the login will be valid for all time.
61+
62+
.SH EXAMPLES
63+
.nf
64+
---
65+
--- Create a user with no password
66+
---
67+
create user tab;
68+
.fi
69+
.nf
70+
---
71+
--- Create a user with a password
72+
---
73+
create user tab with password jw8s0F4;
74+
.fi
75+
.nf
76+
---
77+
--- Create a user with a password, whose account is valid thru 2001
78+
--- Note that after one second has ticked in 2002, the account is not
79+
--- valid
80+
---
81+
create user tab with password jw8s0F4 valid until 'Jan 1 2002';
82+
.fi
83+
.nf
84+
---
85+
--- Create an account where the user can create databases.
86+
---
87+
create user tab with password jw8s0F4 createdb;
88+
.fi
89+
.SH "SEE ALSO"
90+
pg_crypt(3), alter_user(l), drop_user(l).

‎src/man/drop_user.l

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
.\" This is -*-nroff-*-
2+
.\" XXX standard disclaimer belongs here....
3+
.\" $Header: /cvsroot/pgsql/src/man/Attic/drop_user.l,v 1.1 1998/01/25 07:42:02 scrappy Exp $
4+
.TH "DROP USER" SQL 01/26/98 PostgreSQL PostgreSQL
5+
.SH NAME
6+
drop user -- drop user from within a PostgreSQL instance
7+
.SH SYNOPSIS
8+
.nf
9+
\fBdropuser\fR username
10+
.fi
11+
.SH DESCRIPTION
12+
.BR"drop user"
13+
14+
statement removes the named user from a PostgreSQL instance, along with
15+
any databases owned by the user. It does not remove tables, views, or
16+
triggers owned by the named user in database not owned by the user. This
17+
statement can be used in the place of destroyuser(1), regardless of how
18+
the user was created.
19+
20+
.SH EXAMPLES
21+
.nf
22+
---
23+
--- Drop a user
24+
---
25+
drop user tab;
26+
.fi
27+
28+
.SH "SEE ALSO"
29+
alter_user(l), create_user(l).
30+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp