2

I have PostgreSql 9.3 version installed in my ubuntu 14.04 machine. I just installed the 9.4 version as well and the port it is on is 5433(by default). When i give the command psql --version, it gives me the following:

psql (PostgreSQL) 9.4.1

So far so good! Now i am trying to change my password for my postgresql 9.4 and i gave the following command:

>>sudo -u postgres -p 5433 psql
psql (9.4.1, server 9.3.6)
Type "help" for help.

postgres=# alter user postgres with password 'password';
ALTER ROLE
postgres=# \q

Now i tried connecting it on pgadmin3 but it would give me the password authentication failure. Am i doing it right?

1
  • Are the connection/authentication settings in your pg_hba.conf set up correctly? Try connecting with your local IP address in pgadmin. Commented Apr 15, 2015 at 19:08

2 Answers 2

4

sudo -u postgres psql -p 5433

Your -p 5433 as you write it is treated as an option for sudo, not for psql. And you've connected to Postgres 9.3 on standard port.

Sign up to request clarification or add additional context in comments.

1 Comment

but this command is asking for my postgres password which i have not setup yet
4

Try using:

>>sudo -u postgres -p 5433 psql
psql (9.4.1, server 9.3.6)
Type "help" for help.

postgres=# \password
Enter new password:
Enter it again:
postgres=#

2 Comments

can you tell me the exact command? i am a newbie to linux and postgresql
The command is \password, a meta command of psql. Updated answer to include the original code.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.