jackc / tern

The SQL Fan's Migrator
MIT License
925 stars 68 forks source link

Allow setting `port` via tern.conf when not default postgres value of `5432` #25

Closed softwarebygabe closed 3 years ago

softwarebygabe commented 3 years ago

I found that the branch never gets evaluated since pgconn defaults are set before this code, and that the value for the port is 5432 not 0

jackc commented 3 years ago

Good catch on the bug. I ended up fixing it a little differently in a9992da18915bdfe64ebf9bf94a673b5ecd4e4d0. A config file set port should override the default value or even a PGPORT environment variable. All the rest of the config values override environment variables.

So I simply removed the if statement altogether.

softwarebygabe commented 3 years ago

Good call, config hierarchy is better 👍