SQL Reference Contents

NAME

alter user -- alter user account information within a PostgreSQL instance

SYNOPSIS

alter user username
[with password password]
[createdb | nocreatedb ]
[createuser | nocreateuser ]
[in group group-1, ..., group-n]
[valid until ' abstime' ]

DESCRIPTION

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_user to alter user passwords.

If any of the clauses of the alter user statement are omitted, the corresponding value in the pg_user relation is left unchanged.

This statement can be used to modify users created with createuser(1) .

EXAMPLES

---
--- 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;

SEE ALSO

create_user(l) , drop_user(l) .


Table of Contents