pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: a.mitrokhin@postgrespro.ru, Kirill Reshke <reshkekirill@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: Starting a PostgreSQL server on a dynamic port (parameter port=0)
Date: Thu, 10 Jul 2025 10:53:17 +0200
Message-ID: <0ae1aa4b0e3343e2bd2c1b7c41ebeccfe0f65188.camel@cybertec.at> (raw)
In-Reply-To: <a03d0696a0b98a1e91947ffdefa9d6fc@postgrespro.ru>
References: <824bbf6be5fa0edf6a7d4c8371ce67ce@postgrespro.ru>
	<CALdSSPgNJWenx+wGt2pL4oFcuZw21=C3B8AB27b_kayuWZB6yw@mail.gmail.com>
	<a03d0696a0b98a1e91947ffdefa9d6fc@postgrespro.ru>

On Thu, 2025-07-10 at 15:29 +0700, a.mitrokhin@postgrespro.ru wrote:
> > > Postgres does not allow starting the server with port=0, which prevents
> > > it from obtaining an arbitrary free port from the kernel.
> 
> This has nothing to do with Postgres regression tests. The issue is
> the practical benefit of using a dynamic port, which we're depriving
> ourselves of.
> 
> If you're not interested in this behavior, you'll never use it. But
> there are cases where it can be very convenient. Why artificially
> restrict functionality that is simple, doesn't conflict with anything,
> and has no negative side effects?

I have never wished for such a feature, and I can see negative side
effects.  If the server listens on a different port than you expect,
it is easier to connect to the wrong server by mistake.

Yours,
Laurenz Albe





view thread (9+ messages)  latest in thread

Message-ID: <0ae1aa4b0e3343e2bd2c1b7c41ebeccfe0f65188.camel@cybertec.at>
Permalink:  ../0ae1aa4b0e3343e2bd2c1b7c41ebeccfe0f65188.camel@cybertec.at/
Also on:    postgresql.org/message-id/0ae1aa4b0e3343e2bd2c1b7c41ebeccfe0f65188.camel@cybertec.at

 · 

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: laurenz.albe@cybertec.at, reshkekirill@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: Starting a PostgreSQL server on a dynamic port (parameter port=0)
  In-Reply-To: <0ae1aa4b0e3343e2bd2c1b7c41ebeccfe0f65188.camel@cybertec.at>

* 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