pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Francisco Olarte <folarte@peoplecall.com>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Cc: Wong Simon <thbytwo@live.cn>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #17454: Using psql without ipv4 address,the inet_server_port do not return PORT.
Date: Sun, 03 Apr 2022 12:42:34 -0400
Message-ID: <1646105.1649004154@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+bJJbxZ7H6e2YC5JkWGC7pW=SxgLj5BBrdF_=wgF4w0fo3fyQ@mail.gmail.com>
References: <17454-f120d78fa9c3013d@postgresql.org>
	<CAKFQuwavFAL0uSc=FiujzAFdoEDkkz1K6_Sw4o=GNygV18ydbg@mail.gmail.com>
	<OS3PR01MB6344210DA6DD0567F072C187A4E29@OS3PR01MB6344.jpnprd01.prod.outlook.com>
	<CA+bJJbzPYe4py-dnzoKEQ9_m_rvduTs_8BSThwWPUUamSK18dQ@mail.gmail.com>
	<CAKFQuwZy=KscPcsXbRsutx5AcAxJSYMjku_avuP=LmNoGAxpsA@mail.gmail.com>
	<CA+bJJbxZ7H6e2YC5JkWGC7pW=SxgLj5BBrdF_=wgF4w0fo3fyQ@mail.gmail.com>

Francisco Olarte <folarte@peoplecall.com> writes:
>> On Sun, 3 Apr 2022 at 16:50, Wong Simon <thbytwo@live.cn> wrote:
>>> If I run multiple instances on one server with local socket, how can I distinguish them?I think the port is need.

> Port is single valued, what I meant is I'm not sure if using
> socket_dir=/socka, listen_addr=127.0.0.1, data_dir=/dataA and
> port=5432 plus socket_dir=/sockb, listen_addr=127.0.0.2,
> data_dir=/datab and port=5432 would let you start two correctly
> functioning instances in the same machine.

I think relying on port for this purpose is misguided anyway.
We've had requests in the past to let one postmaster listen on
multiple different port numbers; I think the only reason it's
not happened yet is nobody got excited enough to write a patch.

Likewise, inet_server_addr() seems a bit shaky as a server
identity value, since it's already possible to have a postmaster
listening on multiple IP addresses.

If you're trying to identify an installation uniquely, the
machine name and data_directory are probably the best key.
Getting a suitably unique machine name might be tricky.
For localhost connections, though, you could ignore that.

			regards, tom lane





view thread (7+ messages)

Message-ID: <1646105.1649004154@sss.pgh.pa.us>
Permalink:  ../1646105.1649004154@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1646105.1649004154@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, folarte@peoplecall.com, david.g.johnston@gmail.com, thbytwo@live.cn, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17454: Using psql without ipv4 address,the inet_server_port do not return PORT.
  In-Reply-To: <1646105.1649004154@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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