Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita39297e

Browse files
committed
Move check for binary mode and on_error option to the appropriate location.
Commit9e2d870 placed the check for binary mode and on_errorbefore default values were inserted, which was not ideal.This commit moves the check to a more appropriate positionafter default values are set.Additionally, the comment incorrectly mentioned two checks beforeinserting defaults, when there are actually three. This commit correctsthat comment.Author: Atsushi TorikoshiReviewed-by: Fujii MasaoDiscussion:https://postgr.es/m/8830518a-28ac-43a2-8a11-1676d9a3cdf8@oss.nttdata.com
1 parent4ac2a9b commita39297e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

‎src/backend/commands/copy.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ ProcessCopyOptions(ParseState *pstate,
672672
}
673673

674674
/*
675-
* Check for incompatible options (must do thesetwo before inserting
675+
* Check for incompatible options (must do thesethree before inserting
676676
* defaults)
677677
*/
678678
if (opts_out->binary&&opts_out->delim)
@@ -691,11 +691,6 @@ ProcessCopyOptions(ParseState *pstate,
691691
(errcode(ERRCODE_SYNTAX_ERROR),
692692
errmsg("cannot specify %s in BINARY mode","DEFAULT")));
693693

694-
if (opts_out->binary&&opts_out->on_error!=COPY_ON_ERROR_STOP)
695-
ereport(ERROR,
696-
(errcode(ERRCODE_SYNTAX_ERROR),
697-
errmsg("only ON_ERROR STOP is allowed in BINARY mode")));
698-
699694
/* Set defaults for omitted options */
700695
if (!opts_out->delim)
701696
opts_out->delim=opts_out->csv_mode ?"," :"\t";
@@ -900,6 +895,11 @@ ProcessCopyOptions(ParseState *pstate,
900895
errmsg("NULL specification and DEFAULT specification cannot be the same")));
901896
}
902897
/* Check on_error */
898+
if (opts_out->binary&&opts_out->on_error!=COPY_ON_ERROR_STOP)
899+
ereport(ERROR,
900+
(errcode(ERRCODE_SYNTAX_ERROR),
901+
errmsg("only ON_ERROR STOP is allowed in BINARY mode")));
902+
903903
if (opts_out->reject_limit&& !opts_out->on_error)
904904
ereport(ERROR,
905905
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp