pgschema icon indicating copy to clipboard operation
pgschema copied to clipboard

Unable to plan migrations using UNIX socket connection

Open h0rmiga opened this issue 1 year ago • 1 comments

Hi!

pgschema uses two different ways to generate a DNS:

  1. cmd/util/connection.go
  2. internal/postgres/embedded.go

Because of this user can't find working args set to use to connect to local database with UNIX socket. --host=/var/run/postgresql works with first one, --host='' - works with the second one.

I can see two possible solutions here:

  1. Use same DSN generation code in both cases
  2. Connect to UNIX socket by default when host arg is not set - the way psql binary does it.

h0rmiga avatar Nov 01 '25 13:11 h0rmiga

Thanks for reporting this. Go with option 1 to make embedded.go use connection.go as well.

Didn't change the host default because it's already set to localhost.

tianzhou avatar Nov 01 '25 14:11 tianzhou