spilo icon indicating copy to clipboard operation
spilo copied to clipboard

Changing port from 5432 breaks unix socket connections

Open Legogris opened this issue 5 years ago • 3 comments

When changing listening port, connection is attempted to unix socket at incorrect path.

E.g., when setting PGPORT=1337 and listen: *:1337:

psql: error: could not connect to server: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
psql: error: could not connect to server: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
psql: error: could not connect to server: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

Legogris avatar Jul 23 '20 09:07 Legogris

Well, we never expected that someone will use a non-default port in docker container. Not sure that such a use-case is deserving time spent on it.

CyberDem0n avatar Jul 23 '20 09:07 CyberDem0n

Then maybe the env var should be removed? The docs currently state it as configurable.

Legogris avatar Jul 23 '20 09:07 Legogris

Maybe if you add PGPORT here it will fix the issue, that would be an easy win.

CyberDem0n avatar Jul 23 '20 10:07 CyberDem0n