I have set pgpassword in
vim .bashrc export PGPASSWORD=pass_for_postgresql
It is no need to type password for command
psql -U postgres.
When i dump a table from db1 into db2 with :
pg_dump -U postgres -t table db1 | psql -U postgres -W db2
The command will ask me to type password.
I have googled an article to dicuss this
Create a ~/.pgpass file in user’s home directory with the following format:
hostname:port:database:username:password Ex: localhost:5432:mydatabase:lorenz:lorensxyz
There are many databases here,how can write the .pgpass file then?
How can make PG_DUMP work for all databases without asking password?