Skip to content

fix: respect DSN password over PGPASSWORD env var#1562

Open
BillionClaw wants to merge 1 commit intodbcli:mainfrom
BillionClaw:clawoss/fix/pgpassword-dsn-precedence
Open

fix: respect DSN password over PGPASSWORD env var#1562
BillionClaw wants to merge 1 commit intodbcli:mainfrom
BillionClaw:clawoss/fix/pgpassword-dsn-precedence

Conversation

@BillionClaw
Copy link

When connecting via DSN URI containing a password (e.g., postgresql://user:pass@host/db), pgcli incorrectly prioritized the PGPASSWORD environment variable over the password embedded in the DSN. This caused authentication failures when PGPASSWORD was set to a different value.

Changed the connection logic to check if the DSN contains a password before falling back to PGPASSWORD. If a password is present in the DSN, it takes precedence.

Fixes #1555

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PGPASSWORD env variable takes precedence over "password=...." in the DSN uri

1 participant