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

Commita6d0fa5

Browse files
Disallow specifying ON_ERROR option without value.
The ON_ERROR option of the COPY command previously allowed omittingits value, which was inconsistent with the syntax synopsis in thedocumentation and the behavior of other non-boolean COPY options.This change enforces providing a value for the ON_ERROR option,ensuring consistency across other non-boolean options and aligningwith the documented syntax.Author: Atsushi TorikoshiReviewed-by: Masahiko SawadaDiscussion:https://postgr.es/m/a9770bf57646d90dedc3d54cf32634b2%40oss.nttdata.com
1 parent58cf2e1 commita6d0fa5

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

‎src/backend/commands/copy.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -392,24 +392,17 @@ defGetCopyHeaderChoice(DefElem *def, bool is_from)
392392
staticCopyOnErrorChoice
393393
defGetCopyOnErrorChoice(DefElem*def,ParseState*pstate,boolis_from)
394394
{
395-
char*sval;
395+
char*sval=defGetString(def);
396396

397397
if (!is_from)
398398
ereport(ERROR,
399399
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
400400
errmsg("COPY ON_ERROR cannot be used with COPY TO"),
401401
parser_errposition(pstate,def->location)));
402402

403-
/*
404-
* If no parameter value given, assume the default value.
405-
*/
406-
if (def->arg==NULL)
407-
returnCOPY_ON_ERROR_STOP;
408-
409403
/*
410404
* Allow "stop", or "ignore" values.
411405
*/
412-
sval=defGetString(def);
413406
if (pg_strcasecmp(sval,"stop")==0)
414407
returnCOPY_ON_ERROR_STOP;
415408
if (pg_strcasecmp(sval,"ignore")==0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp