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

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Yurii Rashkovskii <yrashk(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Greg Stark <stark(at)mit(dot)edu>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH] Allow Postgres to pick an unused port to listen
Date: 2023-04-19 04:10:27
Message-ID: 3aac0feb-dcf5-ad32-80b4-f8cda556e0f9@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 13.04.23 04:45, Yurii Rashkovskii wrote:
> But getting your agreement is important to get this in; I am willing to
> play along and resolve both (1) and (2) in one go. As for the
> implementation approach for (2), which of the following options would
> you prefer?
>
> a) Document postmaster.pid as it stands today
> b) Expose the port number through pg_ctl (*my personal favorite)
> c) Redesign its content below line 1 to make it extensible (make unnamed
> lines named, for example)
>
> If none of the above options suit you, do you have a strategy you'd prefer?

You could just drop another file into the data directory that just
contains the port number ($PGDATA/port). However, if we ever do
multiple ports, that would still require a change in the format of that
file, so I don't know if that's actually better than a).

I don't think involving pg_ctl is necessary or desirable, since it would
make any future changes like that even more complicated.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2023-04-19 04:21:39 Re: [PATCH] Allow Postgres to pick an unused port to listen
Previous Message Junwang Zhao 2023-04-19 03:51:19 Re: Use INT_MAX for wal size related gucs's max value