psql ignores server port setting through alter system whenconnecting? - Mailing list pgsql-bugs

From Wim Bertels
Subject psql ignores server port setting through alter system whenconnecting?
Date
Msg-id 7d92073a-524c-2bad-af9c-0e00256619a4@ucll.be
Whole thread Raw
Responses Re: psql ignores server port setting through alter system when connecting?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Hallo,

i tested this on two debian stable machines with the apt.postgresql.org
repo enabled. Can anyone confirm this?

Version: 10.1-1.pgdg90+1

Steps to reproduce

1. connect to your db using a unix socket, for example
$ psql --cluster 10/main postgres

2. change the port with alter system, for example
# ALTER SYSTEM set port TO 54331;

3. restart the cluster
# pg_ctlcluster 10 main restart

4. check
# pg_lsclusters
Ver Cluster Port  Status Owner    Data directory               Log file
9.6 main    5432  online postgres /var/lib/postgresql/9.6/main
/var/log/postgresql/postgresql-9.6-main.log
10  main    54331 online postgres /var/lib/postgresql/10/main
/var/log/postgresql/postgresql-10-main.log

5. try to connect again as in 1.
$ psql --cluster 10/main postgres
psql: could not connect to server: Bestand of map bestaat nietIs the server running locally and acceptingconnections on
Unixdomain socket "/var/run/postgresql/.s.PGSQL.5433"?
 

6. check again
$ ss -a | grep 5433
u_str  LISTEN     0      128    /var/run/postgresql/.s.PGSQL.54331
554855                * 0
tcp    LISTEN     0      128    127.0.0.1:54331                 *:*

tcp    LISTEN     0      128       ::1:54331                :::*

Background:
The port in postmaster.conf was always 5433 in this test case, also a
non standard port to try to pinpoint the problem closer.

hth,
Wim



pgsql-bugs by date:

Previous
From: Amit Kapila
Date:
Subject: Re: 10.1: hash index size exploding on vacuum full analyze
Next
From: sagadin@gmail.com
Date:
Subject: BUG #14917: process hang on create index