Skip to content

Conversation

@jackc
Copy link
Owner

@jackc jackc commented Sep 21, 2024

If the sslmode was blank then some of the fallback config was not being set properly. This was because blank is treated as "prefer" by pgx (which follows libpq's behavior). But tern parsing parsing the config in several places and then trying to fix the fallback config. It missed the default "prefer" case.

The solution was to avoid the multiple parsing and fallback config logic entirely. Instead, we set the PG* environment variables from the CLI options and config file before parsing the conn string.

#38

If the sslmode was blank then some of the fallback config was not being
set properly. This was because blank is treated as "prefer" by pgx
(which follows libpq's behavior). But tern parsing parsing the config
in several places and then trying to fix the fallback config. It missed
the default "prefer" case.

The solution was to avoid the multiple parsing and fallback config logic
entirely. Instead, we set the PG* environment variables from the CLI
options and config file before parsing the conn string.

#38
@jackc jackc merged commit c21b410 into master Sep 26, 2024
@jackc jackc deleted the fix-ignored-port-with-unset-sslmode branch September 26, 2024 22:08
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.

2 participants