It's strange, but i've searched around for this source of configuration but couldnt find it out.
Im currently using opensuse 11.3 with postgresql 9.
Every postgresql command line that i issue will ask the current user password, like psql, createdb, dropdb, and i have to enter the password of the current user (which is postgres) to make it work.
Doing dropdb xxx && createdb xxx
will ask the password twice.
Please show me the light !
Thank you :-)
Actually im already running as a postgres user (a user in my linux), so i can psql without supplying the database password, but i still have to supply the password for the system user postgres.
So if the database has a user of dbuser, and im running psql as the postgres (linux user), a password for the linux user (postgres) will be asked, not the dbuser password.
You can create a ~/.pgpass
file (%APPDATA%\postgresql\pgpass.conf
on Windows) with a line in the following format:
hostname:port:database:username:password
See the documentation for details.
If you're on opensuse you should be able to create a .pgpass file by running:
echo "hostname:port:database:username:password" > ~/.pgpass
chmod 0600 ~/.pgpass
With all of the correct information of course.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With