v1-0001-file_fdw-Add-regression-test-for-file_fdw-with-ON.patch
application/octet-stream
Filename: v1-0001-file_fdw-Add-regression-test-for-file_fdw-with-ON.patch
Type: application/octet-stream
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch v1-0001
Subject: file_fdw: Add regression test for file_fdw with ON_ERROR='set_null'.
| File | + | − |
|---|---|---|
| contrib/file_fdw/expected/file_fdw.out | 11 | 1 |
| contrib/file_fdw/sql/file_fdw.sql | 3 | 1 |
From 400adb16a50cc817eaea816fc6735a7b4e7af9aa Mon Sep 17 00:00:00 2001 From: Fujii Masao <fujii@postgresql.org> Date: Wed, 4 Mar 2026 22:19:06 +0900 Subject: [PATCH v1] file_fdw: Add regression test for file_fdw with ON_ERROR='set_null'. Commit 2a525cc97e1 introduced the ON_ERROR = 'set_null' option for COPY, allowing it to be used with foreign tables backed by file_fdw. However, unlike ON_ERROR = 'ignore', no regression test was added to verify this behavior for file_fdw. This commit adds a regression test to ensure that foreign tables using file_fdw work correctly with ON_ERROR = 'set_null', improving test coverage. --- contrib/file_fdw/expected/file_fdw.out | 12 +++++++++++- contrib/file_fdw/sql/file_fdw.sql | 4 +++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/contrib/file_fdw/expected/file_fdw.out b/contrib/file_fdw/expected/file_fdw.out index 251f00bd258..640986528ae 100644 --- a/contrib/file_fdw/expected/file_fdw.out +++ b/contrib/file_fdw/expected/file_fdw.out @@ -246,7 +246,17 @@ SELECT * FROM agg_bad; -- ERROR ERROR: invalid input syntax for type real: "aaa" CONTEXT: COPY agg_bad, line 3, column b: "aaa" -- on_error, log_verbosity and reject_limit tests -ALTER FOREIGN TABLE agg_bad OPTIONS (ADD on_error 'ignore'); +ALTER FOREIGN TABLE agg_bad OPTIONS (ADD on_error 'set_null'); +SELECT * FROM agg_bad; + a | b +-----+-------- + 100 | 99.097 + 0 | _null_ + 42 | 324.78 + 1 | _null_ +(4 rows) + +ALTER FOREIGN TABLE agg_bad OPTIONS (SET on_error 'ignore'); SELECT * FROM agg_bad; NOTICE: 2 rows were skipped due to data type incompatibility a | b diff --git a/contrib/file_fdw/sql/file_fdw.sql b/contrib/file_fdw/sql/file_fdw.sql index 2cba84b1db7..56bfc926c00 100644 --- a/contrib/file_fdw/sql/file_fdw.sql +++ b/contrib/file_fdw/sql/file_fdw.sql @@ -171,7 +171,9 @@ SELECT * FROM agg_csv c JOIN agg_text t ON (t.a = c.a) ORDER BY c.a; SELECT * FROM agg_bad; -- ERROR -- on_error, log_verbosity and reject_limit tests -ALTER FOREIGN TABLE agg_bad OPTIONS (ADD on_error 'ignore'); +ALTER FOREIGN TABLE agg_bad OPTIONS (ADD on_error 'set_null'); +SELECT * FROM agg_bad; +ALTER FOREIGN TABLE agg_bad OPTIONS (SET on_error 'ignore'); SELECT * FROM agg_bad; ALTER FOREIGN TABLE agg_bad OPTIONS (ADD log_verbosity 'silent'); SELECT * FROM agg_bad; -- 2.51.2