Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uZn1v-0088Sb-Fq for pgsql-bugs@arkaria.postgresql.org; Thu, 10 Jul 2025 08:53:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uZn1t-00AFSk-H5 for pgsql-bugs@arkaria.postgresql.org; Thu, 10 Jul 2025 08:53:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uZn1t-00AFSN-7Z for pgsql-bugs@lists.postgresql.org; Thu, 10 Jul 2025 08:53:21 +0000 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uZn1r-006oP7-2l for pgsql-bugs@lists.postgresql.org; Thu, 10 Jul 2025 08:53:21 +0000 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-450ccda1a6eso5819035e9.2 for ; Thu, 10 Jul 2025 01:53:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1752137599; x=1752742399; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=mclIOQhOLoNnPRSgy9bq/9h/fwYmvrPQLZ0j+lb0fUw=; b=fQY+AaPNpSIPI1tOY8pnEr6cVi4AAf6ZLTxonBy/sa6FuZYlRu8YlPYhEWlwy08ZuB 0KNeiY0mYRUHYJCdJkHUwpnI8SXvMieTFPWIRS1sUDhkg100NK7TUUg+lp4yh8rFtbCK jwVxe3Xivvm1d6Pob1kQpHtIJ/S5M8I3MhYPUYDUV16iyETyf2wu2d2p8KbZWoQP2aTC XcBGM8HY/7R8zS1Gx0hi8zO7k9mOPRXS3PIUjGX/gbQN2J2AO694T3NEWr7UHkKmkpZE th4iyfAWIeg1HQIY8KRvXuyci8Tyi0U+kvnwgQNHZzRrQzVbCamXkSdn6iffnprVbDaG hKsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752137599; x=1752742399; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=mclIOQhOLoNnPRSgy9bq/9h/fwYmvrPQLZ0j+lb0fUw=; b=SqWwBTrgC8AG6xgU8mocFYg7R7JNfOBRTbNOEnJtbzJBZ15CKLjCkBt8bgNhvUBjN7 lSTR6ScWMe6GOF18FcZ76uz5cjBsO3lqrV+DONzyn/ymEbZtei8bzpz9v1GzFIg5MR3F nGEF3kA9V+oIY3uTVMMlWMjc++4qFfE8OtbqRsXJf+DReHuKfYhUm55Ogyd0KFwKzwdI h637QgpWQq+M7WLiRpfCGh+YKbzCejsI7SdfnqU0PxI4+Nj5Iq1dGSJdp/YMxbwrsvrE u/Km0DMOS1dPsgHnz+eoyJRrQVmMXYxxi/mvJiAwBC/eUA74WixP7bxHKUzkNyrWtQ8d fYYA== X-Gm-Message-State: AOJu0Yya6BsDCgcn8reh30gQXZCEJhuKwXfpbJoR97kZ7Lqau6yz33qq +OIl1Zl13SgT8XIeH87468Hp2nADfiFSICcDR7o0LgI0fUPSh63Nn+h6S1mjwzFsbiM= X-Gm-Gg: ASbGncs2RZC86b47gVbg2RyumFkbYguZ2Hxjpr/QKbsF6PiPkTOqu0V+zCluxKoMd9h pgohs6C9XFTs/rlYk8cw07+SECd99nZfDk6ODX4gXi8sfBUPsk5rI3z5+mNwkerCYKIYTPy8YiG sZ3feDyWWXu6hauVBH12XDcXpfrFglGL7RaQdUdSYD/ZvwWTL5vZZdQDqbOk/cZbSSvk+meJDMb +7duIfZZMPzcnf12LbHQeyyufZH4KINT27X0L3j19D7ZEfKl7Uct1I70N174BXD00Bw6uX5/ofz 6IK3ZyBvbWDySAPdmyvc6bG+2IXm70cJIKTLCj5arAwe0LFkkoTNo+7TzAwCbh+84BmwWBgUgYW l1O1K37bUMO9A9Q== X-Google-Smtp-Source: AGHT+IHMlwEtH8tfegvysV8CRtfpVi/SfgobqyDZaVeKARF2inJePy0R5faf0An0a+qpMMcY+HHerA== X-Received: by 2002:a05:600c:154b:b0:450:d3b9:4bac with SMTP id 5b1f17b1804b1-454db887943mr24513965e9.28.1752137598580; Thu, 10 Jul 2025 01:53:18 -0700 (PDT) Received: from laurenz.albe-K4N0CV00F97414D ([2001:871:5e:4e0d:c82b:c9c0:5ad:c496]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-454dd54bff0sm13116595e9.35.2025.07.10.01.53.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jul 2025 01:53:18 -0700 (PDT) Message-ID: <0ae1aa4b0e3343e2bd2c1b7c41ebeccfe0f65188.camel@cybertec.at> Subject: Re: Starting a PostgreSQL server on a dynamic port (parameter port=0) From: Laurenz Albe To: a.mitrokhin@postgrespro.ru, Kirill Reshke Cc: pgsql-bugs@lists.postgresql.org Date: Thu, 10 Jul 2025 10:53:17 +0200 In-Reply-To: References: <824bbf6be5fa0edf6a7d4c8371ce67ce@postgrespro.ru> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2 (3.56.2-1.fc42) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 2025-07-10 at 15:29 +0700, a.mitrokhin@postgrespro.ru wrote: > > > Postgres does not allow starting the server with port=3D0, which prev= ents > > > it from obtaining an arbitrary free port from the kernel. >=20 > 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. >=20 > 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