]> begriffs open source - ai-pg/blob - full-docs/man7/ALTER_USER.7
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / man7 / ALTER_USER.7
1 '\" t
2 .\"     Title: ALTER USER
3 .\"    Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
5 .\"      Date: 2025
6 .\"    Manual: PostgreSQL 18.0 Documentation
7 .\"    Source: PostgreSQL 18.0
8 .\"  Language: English
9 .\"
10 .TH "ALTER USER" "7" "2025" "PostgreSQL 18.0" "PostgreSQL 18.0 Documentation"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 ALTER_USER \- change a database role
32 .SH "SYNOPSIS"
33 .sp
34 .nf
35 ALTER USER \fIrole_specification\fR [ WITH ] \fIoption\fR [ \&.\&.\&. ]
36
37 where \fIoption\fR can be:
38
39       SUPERUSER | NOSUPERUSER
40     | CREATEDB | NOCREATEDB
41     | CREATEROLE | NOCREATEROLE
42     | INHERIT | NOINHERIT
43     | LOGIN | NOLOGIN
44     | REPLICATION | NOREPLICATION
45     | BYPASSRLS | NOBYPASSRLS
46     | CONNECTION LIMIT \fIconnlimit\fR
47     | [ ENCRYPTED ] PASSWORD \*(Aq\fIpassword\fR\*(Aq | PASSWORD NULL
48     | VALID UNTIL \*(Aq\fItimestamp\fR\*(Aq
49
50 ALTER USER \fIname\fR RENAME TO \fInew_name\fR
51
52 ALTER USER { \fIrole_specification\fR | ALL } [ IN DATABASE \fIdatabase_name\fR ] SET \fIconfiguration_parameter\fR { TO | = } { \fIvalue\fR | DEFAULT }
53 ALTER USER { \fIrole_specification\fR | ALL } [ IN DATABASE \fIdatabase_name\fR ] SET \fIconfiguration_parameter\fR FROM CURRENT
54 ALTER USER { \fIrole_specification\fR | ALL } [ IN DATABASE \fIdatabase_name\fR ] RESET \fIconfiguration_parameter\fR
55 ALTER USER { \fIrole_specification\fR | ALL } [ IN DATABASE \fIdatabase_name\fR ] RESET ALL
56
57 where \fIrole_specification\fR can be:
58
59     \fIrole_name\fR
60   | CURRENT_ROLE
61   | CURRENT_USER
62   | SESSION_USER
63 .fi
64 .SH "DESCRIPTION"
65 .PP
66 \fBALTER USER\fR
67 is now an alias for
68 \fBALTER ROLE\fR\&.
69 .SH "COMPATIBILITY"
70 .PP
71 The
72 \fBALTER USER\fR
73 statement is a
74 PostgreSQL
75 extension\&. The SQL standard leaves the definition of users to the implementation\&.
76 .SH "SEE ALSO"
77 ALTER ROLE (\fBALTER_ROLE\fR(7))