Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hGCL4-000221-RG for pgsql-committers@arkaria.postgresql.org; Tue, 16 Apr 2019 00:52:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hGCL3-0005yN-G4 for pgsql-committers@arkaria.postgresql.org; Tue, 16 Apr 2019 00:52:41 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hGCL3-0005yG-5p for pgsql-committers@lists.postgresql.org; Tue, 16 Apr 2019 00:52:41 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hGCL0-0004ub-VQ for pgsql-committers@lists.postgresql.org; Tue, 16 Apr 2019 00:52:40 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x3G0qame028363; Mon, 15 Apr 2019 20:52:36 -0400 From: Tom Lane To: Noah Misch cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Consistently test for in-use shared memory. In-reply-to: <20190416005019.GA3296237@rfd.leadboat.com> References: <26478.1555373328@sss.pgh.pa.us> <20190416005019.GA3296237@rfd.leadboat.com> Comments: In-reply-to Noah Misch message dated "Mon, 15 Apr 2019 17:50:19 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <28361.1555375956.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 15 Apr 2019 20:52:36 -0400 Message-ID: <28362.1555375956@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Noah Misch writes: > On Mon, Apr 15, 2019 at 08:08:48PM -0400, Tom Lane wrote: >> I interpret this as "the single-user backend exited before we could stu= ff >> 'SELECT 1 + 1' down the pipe to it, and the Perl script is not expectin= g >> to get a write failure there". > Perhaps I should write the 'SELECT 1 + 1' to a regular file and redirect= input > from that file. Yeah, that was the first idea that occurred to me as well. Kinda grotty, but ... Another idea is to shove the problem off on a sub-shell, that is run echo SELECT 1 + 1 | postgres --single ... regards, tom lane