pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
psql ignores server port setting through alter system when connecting?
2+ messages / 2 participants
[nested] [flat]

* psql ignores server port setting through alter system when connecting?
@ 2017-11-17 11:04 Wim Bertels <wim.bertels@ucll.be>
  2017-11-17 14:59 ` Re: psql ignores server port setting through alter system when connecting? Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: Wim Bertels @ 2017-11-17 11:04 UTC (permalink / raw)
  To: 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 niet
	Is the server running locally and accepting
	connections on Unix domain 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





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: psql ignores server port setting through alter system when connecting?
  2017-11-17 11:04 psql ignores server port setting through alter system when connecting? Wim Bertels <wim.bertels@ucll.be>
@ 2017-11-17 14:59 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2017-11-17 14:59 UTC (permalink / raw)
  To: Wim Bertels <wim.bertels@ucll.be>; +Cc: pgsql-bugs

Wim Bertels <wim.bertels@ucll.be> writes:
> i tested this on two debian stable machines with the apt.postgresql.org
> repo enabled. Can anyone confirm this?

How would you expect psql to know about a server setting before
connecting?

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2017-11-17 14:59 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-11-17 11:04 psql ignores server port setting through alter system when connecting? Wim Bertels <wim.bertels@ucll.be>
2017-11-17 14:59 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox