Re: [PATCH] Allow Postgres to pick an unused port to listen

From: Yurii Rashkovskii <yrashk(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH] Allow Postgres to pick an unused port to listen
Date: 2023-04-06 22:17:05
Message-ID: CA+RLCQy9q4Ycv6QWeyHJrmDvcBD-auBr6uYbp2RbwJHVO2BCWg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Tom,

On Wed, Mar 29, 2023 at 6:55 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Yurii Rashkovskii <yrashk(at)gmail(dot)com> writes:
> > I would like to suggest a patch against master (although it may be worth
> > backporting it) that makes it possible to listen on any unused port.
>
> I think this is a bad idea, mainly because this:
>
> > Instead, with this patch, one can specify `port` as `0` (the "wildcard"
> > port) and retrieve the assigned port from postmaster.pid
>
> is a horrid way to find out what was picked, and yet there could
> be no other.
>

I answered you before (
https://www.postgresql.org/message-id/CA+RLCQwYw-Er-E_RGNCDfA514w+1YL8HGhNstxX=y1gLAABFdA@mail.gmail.com),
but I am wondering whether you missed that response. I would really be
interested to learn why you think reading port from the pid file is a
"horrid way" to find out what was picked.

I've outlined my reasoning for this feature in detail in the referenced
message. Hope you can consider it.

--
http://omnigres.org
Yurii

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2023-04-06 22:33:11 Re: cursor use vs pg_stat_statements
Previous Message Greg Stark 2023-04-06 22:14:48 Re: Temporary tables versus wraparound... again