I try to use the command to migrate data between two PG servers, but both need password:
pg_dump -h localhost -U localuser dbname | psql -h remotehost -U remoteuser dbname
Then I get the error:
pg_dump: [archiver (db)] connection to database "database" failed: FATAL: password authentication failed for user "postgres"
Is there any option to solve the issue? I'm not sure how to specific the password in the command.