How to use ALTER USER command in PostgreSQL
ALTER USER changes the attributes of a PostgreSQL user account.
Examples
1.Change a user's password:
ALTER USER davide WITH PASSWORD 'hu8jmn3';
2.Change the expiration date of the user's password:
ALTER USER manuel VALID UNTIL 'Jan 31 2030';
3.Change a password expiration date, specifying that the password should expire at midday on 4th May 2005 using the time zone which is one hour ahead of UTC:
ALTER USER chris VALID UNTIL 'May 4 12:00:00 2005 +1';
4.Make a password valid forever:
ALTER USER fred VALID UNTIL 'infinity';
5.Give a user the ability to create other users and new databases:
ALTER USER miriam CREATEUSER CREATEDB;
Comments