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 1gNhni-0004fC-6Y for pgsql-hackers@arkaria.postgresql.org; Fri, 16 Nov 2018 17:21:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gNhng-0003f6-HH for pgsql-hackers@arkaria.postgresql.org; Fri, 16 Nov 2018 17:21:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gNhng-0003ez-9b for pgsql-hackers@lists.postgresql.org; Fri, 16 Nov 2018 17:21:00 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gNhnd-0005Zg-U7 for pgsql-hackers@lists.postgresql.org; Fri, 16 Nov 2018 17:20:59 +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 wAGHKptC030745; Fri, 16 Nov 2018 12:20:51 -0500 From: Tom Lane To: Etsuro Fujita cc: Kyotaro HORIGUCHI , thomas.munro@enterprisedb.com, eric.cyr@gmail.com, pgsql-hackers@lists.postgresql.org Subject: Re: BUG #15449: file_fdw using program cause exit code error when using LIMIT In-reply-to: <5BEA9E82.1080709@lab.ntt.co.jp> References: <5BE4318F.4040002@lab.ntt.co.jp> <20181109.143931.243136889.horiguchi.kyotaro@lab.ntt.co.jp> <5BE552ED.4040304@lab.ntt.co.jp> <20181112.185214.76711162.horiguchi.kyotaro@lab.ntt.co.jp> <5BE966F4.1040702@lab.ntt.co.jp> <5BEA9E82.1080709@lab.ntt.co.jp> Comments: In-reply-to Etsuro Fujita message dated "Tue, 13 Nov 2018 18:50:58 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <30743.1542388851.1@sss.pgh.pa.us> Date: Fri, 16 Nov 2018 12:20:51 -0500 Message-ID: <30744.1542388851@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Etsuro Fujita writes: > * I think it's better to ignore the SIGPIPE failure in > ClosePipeToProgram if we were in a COPY FROM PROGRAM that was allowed to > terminate early and keep the behavior as-is otherwise. If we ignore > that failure unconditionally in that function, eg, COPY TO PROGRAM would > fail to get a (better) error message in CopySendEndOfRow or EndCopy when > the invoked program was terminated on SIGPIPE, as discussed before [1]. > And to do so, I added a new argument to BeginCopyFrom to specify > whether COPY FROM PROGRAM can terminate early or not. If we do that, it makes this not back-patchable, I fear --- the fact that file_fdw is calling BeginCopyFrom seems like sufficient evidence that there might be third-party callers who would object to an API break in minor releases. That seems unfortunate for a bug fix. Are we sufficiently convinced that we must have the dont-allow-partial option to not fix this in the back branches? I'm not. regards, tom lane