1ALTER USER(7) PostgreSQL 15.4 Documentation ALTER USER(7)
2
3
4
6 ALTER_USER - change a database role
7
9 ALTER USER role_specification [ WITH ] option [ ... ]
10
11 where option can be:
12
13 SUPERUSER | NOSUPERUSER
14 | CREATEDB | NOCREATEDB
15 | CREATEROLE | NOCREATEROLE
16 | INHERIT | NOINHERIT
17 | LOGIN | NOLOGIN
18 | REPLICATION | NOREPLICATION
19 | BYPASSRLS | NOBYPASSRLS
20 | CONNECTION LIMIT connlimit
21 | [ ENCRYPTED ] PASSWORD 'password' | PASSWORD NULL
22 | VALID UNTIL 'timestamp'
23
24 ALTER USER name RENAME TO new_name
25
26 ALTER USER { role_specification | ALL } [ IN DATABASE database_name ] SET configuration_parameter { TO | = } { value | DEFAULT }
27 ALTER USER { role_specification | ALL } [ IN DATABASE database_name ] SET configuration_parameter FROM CURRENT
28 ALTER USER { role_specification | ALL } [ IN DATABASE database_name ] RESET configuration_parameter
29 ALTER USER { role_specification | ALL } [ IN DATABASE database_name ] RESET ALL
30
31 where role_specification can be:
32
33 role_name
34 | CURRENT_ROLE
35 | CURRENT_USER
36 | SESSION_USER
37
39 ALTER USER is now an alias for ALTER ROLE.
40
42 The ALTER USER statement is a PostgreSQL extension. The SQL standard
43 leaves the definition of users to the implementation.
44
46 ALTER ROLE (ALTER_ROLE(7))
47
48
49
50PostgreSQL 15.4 2023 ALTER USER(7)