From: Tom Lane <tgl@sss.pgh.pa.us>
To: Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>
Cc: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Cc: thomas.munro@enterprisedb.com
Cc: eric.cyr@gmail.com
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: BUG #15449: file_fdw using program cause exit code error when using LIMIT
Date: Mon, 19 Nov 2018 17:12:53 -0500
Message-ID: <30691.1542665573@sss.pgh.pa.us> (raw)
In-Reply-To: <5BF23697.6020806@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>
<30744.1542388851@sss.pgh.pa.us>
<31355.1542389631@sss.pgh.pa.us>
<7865.1542407597@sss.pgh.pa.us>
<9660.1542409841@sss.pgh.pa.us>
<5BF23697.6020806@lab.ntt.co.jp>
Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp> writes:
> I agree that it's better to keep the BeginCopyFrom API as-is. Also, I
> think your version would handle SIGPIPE in COPY FROM PROGRAM more
> properly than what I proposed. So, +1 from me.
Thanks for reviewing! I've pushed it now, though at the last minute
I reconsidered resetting SIGUSR2 as my previous patch did. The trouble
with resetting that is that it results in a small window where receipt
of SIGUSR2 would result in backend termination, which we surely don't
want. Now, it doesn't look to me like the postmaster will ever send
SIGUSR2 to ordinary backends, but it wouldn't be terribly surprising
if someone makes a change that relies on the expectation of SIGUSR2
being SIG_IGN'd by backends. I don't see any real upside to resetting
SIGUSR2 for the called program that would justify taking any risk
there. (Note that this concern doesn't apply to SIGPIPE since we
only expect that to be raised synchronously, ie during a write.)
As Kyotaro-san said upthread, it's odd that exec() provides no
way to reset all the handlers to SIG_DFL on the child side.
But since it doesn't, we're not really able to do much more than
this.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, fujita.etsuro@lab.ntt.co.jp, horiguchi.kyotaro@lab.ntt.co.jp, 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: <30691.1542665573@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox