Pages

Friday, September 24, 2010

Postgres - How to Change the password for a user account ?

If you forgot the password or want
to change the password of a user account
in postgres, use the following query.

alter user UserName with password 'password'

Example:

alter user postgres with password 'postgres'

Here the user account is postgres
and password in postgres.

thats it !

2 comments:

  1. first of all thanks.

    but i want to create a user.


    and How can i create new user in postgres.

    plz help me.

    ReplyDelete
    Replies
    1. Create a user with no password:

      CREATE USER jonathan;
      Create a user with a password:

      CREATE USER davide WITH PASSWORD 'jw8s0F4';

      You may refer this link.

      http://www.postgresql.org/docs/8.0/static/sql-createuser.html


      You can create new user using command line tools like psql or
      GUI based - pgadmin3

      Delete