Re: BUG #15449: file_fdw using program cause exit code error when using LIMIT
Tom Lane <tgl@sss.pgh.pa.us>
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>,
thomas.munro@enterprisedb.com, eric.cyr@gmail.com,
pgsql-hackers@lists.postgresql.org
Date: 2018-11-19T22:12:53Z
Lists: pgsql-bugs, pgsql-hackers
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
Commits
-
Handle EPIPE more sanely when we close a pipe reading from a program.
- ffa4cbd623dd 12.0 landed
- 8dc49a8934de 11.2 landed
- 8285fae0706f 10.7 landed
-
Avoid defining SIGTTIN/SIGTTOU on Windows.
- 37afc079abe1 12.0 landed
-
Leave SIGTTIN/SIGTTOU signal handling alone in postmaster child processes.
- 125f551c8be1 12.0 landed
-
Remove some unnecessary pqsignal() calls to shave a few cycles off
- 8e2998d8a6ae 7.3.1 cited
-
Fix handling of SIGCHLD, per recent pghackers discussion: on some
- dad8e410d0c4 7.2.1 cited
-
The new files for statistical system views.
- 140ddb78fe62 7.2.1 cited
-
Remove fork()/exec() and only do fork(). Small cleanups.
- 212c905e2c5a 7.1.1 cited