Re: [PATCH] Allow Postgres to pick an unused port to listen - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: [PATCH] Allow Postgres to pick an unused port to listen
Date
Msg-id 3aac0feb-dcf5-ad32-80b4-f8cda556e0f9@enterprisedb.com
Whole thread Raw
In response to Re: [PATCH] Allow Postgres to pick an unused port to listen  (Yurii Rashkovskii <yrashk@gmail.com>)
Responses Re: [PATCH] Allow Postgres to pick an unused port to listen
List 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.



pgsql-hackers by date:

Previous
From: Junwang Zhao
Date:
Subject: Re: Use INT_MAX for wal size related gucs's max value
Next
From: Stephen Frost
Date:
Subject: Re: [PATCH] Allow Postgres to pick an unused port to listen