Re: Starting a PostgreSQL server on a dynamic port (parameter port=0)

From: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, a(dot)mitrokhin(at)postgrespro(dot)ru, Kirill Reshke <reshkekirill(at)gmail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: Starting a PostgreSQL server on a dynamic port (parameter port=0)
Date: 2025-07-10 09:13:31
Message-ID: ac7e4a4a-28ef-4a69-8f20-5bf2e7385c85@uni-muenster.de
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 10.07.25 10:53, Laurenz Albe wrote:
> 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.

Moreover, there's a risk that postgres could potentially hijack the port
of an application that's not currently running, but has a fixed port
configuration assigned to it. This could, in turn, prevent the
application from starting up successfully.

I can understand why it might be attractive for some scenarios, but the
risks and consequences could outweigh the benefits.

Best, Jim

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Fujii Masao 2025-07-10 10:27:08 Re: Unexpected behavior when setting "idle_replication_slot_timeout"
Previous Message Laurenz Albe 2025-07-10 08:53:17 Re: Starting a PostgreSQL server on a dynamic port (parameter port=0)