Re: BUG #17454: Using psql without ipv4 address,the inet_server_port do not return PORT.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #17454: Using psql without ipv4 address,the inet_server_port do not return PORT.
Дата
Msg-id 1646105.1649004154@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #17454: Using psql without ipv4 address,the inet_server_port do not return PORT.  (Francisco Olarte <folarte@peoplecall.com>)
Список pgsql-bugs
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



В списке pgsql-bugs по дате отправления:

Предыдущее
От: Francisco Olarte
Дата:
Сообщение: Re: BUG #17454: Using psql without ipv4 address,the inet_server_port do not return PORT.
Следующее
От: "Lorenz, Christopher"
Дата:
Сообщение: AW: BUG #17393: Delete database after recovery with point-in-time is still missing datafiles