Re: BUG #15449: file_fdw using program cause exit code error when using LIMIT

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, thomas(dot)munro(at)enterprisedb(dot)com, eric(dot)cyr(at)gmail(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15449: file_fdw using program cause exit code error when using LIMIT
Date: 2018-11-16 17:20:51
Message-ID: 30744.1542388851@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> 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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2018-11-16 17:33:51 Re: BUG #15449: file_fdw using program cause exit code error when using LIMIT
Previous Message Tom Lane 2018-11-16 16:18:41 Re: BUG #15160: planner overestimates number of rows in join when there are more than 200 rows coming from CTE

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-11-16 17:33:51 Re: BUG #15449: file_fdw using program cause exit code error when using LIMIT
Previous Message Alvaro Herrera 2018-11-16 17:17:23 Re: Speeding up INSERTs and UPDATEs to partitioned tables