BUG #15449: file_fdw using program cause exit code error when using LIMIT
The Post Office <noreply@postgresql.org>
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: eric.cyr@gmail.com
Date: 2018-10-22T14:00:50Z
Lists: pgsql-bugs, pgsql-hackers
The following bug has been logged on the website:
Bug reference: 15449
Logged by: Eric Cyr
Email address: eric.cyr@gmail.com
PostgreSQL version: 10.5
Operating system: Ubuntu 16.04.2 LTS (Xenial Xerus)
Description:
CREATE FOREIGN TABLE test_file_fdw_program_limit
(
message text
)
SERVER pg_log_fdw OPTIONS (program 'echo "test"', format 'csv')
;
--
SELECT * FROM test_file_fdw_program_limit;
/*
OK
*/
SELECT * FROM test_file_fdw_program_limit LIMIT 2;
/*
OK
*/
SELECT * FROM test_file_fdw_program_limit LIMIT 0;
/*
[38000] ERROR: program "echo "test"" failed Detail: child process exited
with exit code 1
*/
--
LIMIT 0 is the easiest way we found to reproduce the error, but we
encountered same issue with LIMIT (< file lines) on a program doing an if
exists + file output stream manipulation.
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