Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pmehm-0008Iq-43 for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Apr 2023 17:56:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pmehk-00050Z-UX for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Apr 2023 17:56:24 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pmehk-00050Q-Kh for pgsql-hackers@lists.postgresql.org; Wed, 12 Apr 2023 17:56:24 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pmehi-0003Ew-Cs for pgsql-hackers@lists.postgresql.org; Wed, 12 Apr 2023 17:56:23 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 33CHuIMW1161674; Wed, 12 Apr 2023 13:56:18 -0400 From: Tom Lane To: Robert Haas cc: Greg Stark , Yurii Rashkovskii , Andrew Dunstan , pgsql-hackers@lists.postgresql.org Subject: Re: [PATCH] Allow Postgres to pick an unused port to listen In-reply-to: References: <3803291.1680090943@sss.pgh.pa.us> <00a339c9-9749-dcd5-edba-b0968b7159cb@dunslane.net> Comments: In-reply-to Robert Haas message dated "Wed, 12 Apr 2023 13:51:40 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1161672.1681322178.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Wed, 12 Apr 2023 13:56:18 -0400 Message-ID: <1161673.1681322178@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Robert Haas writes: > On Wed, Apr 12, 2023 at 1:31 PM Greg Stark wrote: >> I don't object to using the pid file as the mechanism -- but it is a >> bit of an awkward UI for shell scripting. I imagine it would be handy >> if pg_ctl had an option to just print the port number so you could get >> it with a simple port=`pg_ctl -D status-port` > That's not a bad idea, and would provide some additional isolation to > reduce direct dependency on the PID file format. Yeah. My main concern here is with limiting our ability to change the pidfile format in future. If we can keep the dependencies on that localized to code we control, it'd be much better. regards, tom lane