dbcli / pgcli

Postgres CLI with autocompletion and syntax highlighting
http://pgcli.com
BSD 3-Clause "New" or "Revised" License
12.04k stars 553 forks source link

No password supplied when trying to switch db using .pgpass file #1477

Closed zoiman closed 1 month ago

zoiman commented 1 month ago

Description

I am using an alias_dsn and a .pgpass The alias looks like this:

mydb= 'postgresql://postgres@mydbcluster:5432/myInitialDB'

and the corresponding part in the .pgpass file looks like this:

mydbcluster:5432:myInitialDB:password

I can connect without entering the password with the alias, but when I try to switch the db via \connect otherDB I get the following error:

connection failed: connection to server at "someIP", port 5432 failed: fe_sendauth: no password supplied

Your environment

zoiman commented 1 month ago

sorry my bad, the solution is to just supply the same entry in .pgpass file for each db.