Evrytime i run, su - postgres
it asks me for a password which I did not set. I simply installed the postgres. I have gone to the pg_hba.conf.
# Database administrative login by Unix domain socket
local all postgres trust
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all ident
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
I changed the postgres method from ident
to trust
and then ran sudo /etc/init.d/postgresql restart
. Even then it continues to ask for password. i am not sure where am I going wrong?
What should I do?
1 Answer 1
I was finally able to solve the issue thanks to this site,
http://scratching.psybermonkey.net/2009/06/postgresql-how-to-reset-user-name.html
su
is done by the operating system not by Postgres.postgres
user in the OS. if you're a sudoer, you cansudo su - postgres
. If you're not a sudoer then you probably shouldn't be attempting this anyway. Also, you should revert the changes that you made in youpg_hba.conf
file.