GNU/Linux |
RedHat 5.2(Apollo) |
|
![]() |
alter_user(l) |
![]() |
alter user -- alter user account information within a PostgreSQL instance
alter user username
[with password password] | |||
[createdb | nocreatedb] | |||
[createuser | nocreateuser] | |||
[in group group-1, ..., group-n] | |||
[valid until ’abstime’] |
alter user is used to change the attributes of a user’s PostgreSQL account. For a detailed description of each of the clause in the alter user statement, please see the create_user(l) manual page. 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 postgres user or any user with read and modify permissions on pg_shadow to alter user passwords.
If any of the clauses of the alter user statement are omitted, the corresponding value in the pg_shadow relation is left unchanged.
This statement can be used to modify users created with createuser(1).
---
--- Change a user password
---
alter user tab with password hu8jmn3;
---
--- Change a user’s valid until date
---
alter user tab valid until ’Jan 31 2030’;
---
--- Give a user the ability to create other users.
---
alter user tab createuser;
create_user(l), drop_user(l).
![]() |
alter_user(l) | ![]() |