Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 631db1d

Browse files
committed
file_fdw: Add regression tests for ON_ERROR and other options.
This commit introduces regression tests to validate incorrect settings for the ON_ERROR, LOG_VERBOSITY, and REJECT_LIMIT options in file_fdw. Author: Atsushi Torikoshi Reviewed-by: Fujii Masao Suggested-by: Yugo Nagata Discussion: https://postgr.es/m/20241113231706.09e5b5ea9640289312835be8@sraoss.co.jp
1 parent af35fe5 commit 631db1d

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

contrib/file_fdw/expected/file_fdw.out

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,16 @@ ERROR: COPY delimiter cannot be newline or carriage return
9090
CREATE FOREIGN TABLE tbl () SERVER file_server OPTIONS (format 'csv', null '
9191
'); -- ERROR
9292
ERROR: COPY null representation cannot use newline or carriage return
93+
CREATE FOREIGN TABLE tbl () SERVER file_server OPTIONS (on_error 'unsupported'); -- ERROR
94+
ERROR: COPY ON_ERROR "unsupported" not recognized
95+
CREATE FOREIGN TABLE tbl () SERVER file_server OPTIONS (format 'binary', on_error 'ignore'); -- ERROR
96+
ERROR: only ON_ERROR STOP is allowed in BINARY mode
97+
CREATE FOREIGN TABLE tbl () SERVER file_server OPTIONS (log_verbosity 'unsupported'); -- ERROR
98+
ERROR: COPY LOG_VERBOSITY "unsupported" not recognized
9399
CREATE FOREIGN TABLE tbl () SERVER file_server OPTIONS (reject_limit '1'); -- ERROR
94100
ERROR: COPY REJECT_LIMIT requires ON_ERROR to be set to IGNORE
101+
CREATE FOREIGN TABLE tbl () SERVER file_server OPTIONS (on_error 'ignore', reject_limit '0'); -- ERROR
102+
ERROR: REJECT_LIMIT (0) must be greater than zero
95103
CREATE FOREIGN TABLE tbl () SERVER file_server; -- ERROR
96104
ERROR: either filename or program is required for file_fdw foreign tables
97105
\set filename :abs_srcdir '/data/agg.data'

contrib/file_fdw/sql/file_fdw.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,11 @@ CREATE FOREIGN TABLE tbl () SERVER file_server OPTIONS (format 'csv', delimiter
7777
'); -- ERROR
7878
CREATE FOREIGN TABLE tbl () SERVER file_server OPTIONS (format 'csv', null '
7979
'); -- ERROR
80+
CREATE FOREIGN TABLE tbl () SERVER file_server OPTIONS (on_error 'unsupported'); -- ERROR
81+
CREATE FOREIGN TABLE tbl () SERVER file_server OPTIONS (format 'binary', on_error 'ignore'); -- ERROR
82+
CREATE FOREIGN TABLE tbl () SERVER file_server OPTIONS (log_verbosity 'unsupported'); -- ERROR
8083
CREATE FOREIGN TABLE tbl () SERVER file_server OPTIONS (reject_limit '1'); -- ERROR
84+
CREATE FOREIGN TABLE tbl () SERVER file_server OPTIONS (on_error 'ignore', reject_limit '0'); -- ERROR
8185
CREATE FOREIGN TABLE tbl () SERVER file_server; -- ERROR
8286
8387
\set filename :abs_srcdir '/data/agg.data'

0 commit comments

Comments
 (0)