@@ -397,7 +397,9 @@ defGetCopyOnErrorChoice(DefElem *def, ParseState *pstate, bool is_from)
397397if (!is_from )
398398ereport (ERROR ,
399399(errcode (ERRCODE_INVALID_PARAMETER_VALUE ),
400- errmsg ("COPY ON_ERROR cannot be used with COPY TO" ),
400+ /*- translator: first %s is the name of a COPY option, e.g. ON_ERROR,
401+ second %s is a COPY with direction, e.g. COPY TO */
402+ errmsg ("COPY %s cannot be used with %s" ,"ON_ERROR" ,"COPY TO" ),
401403parser_errposition (pstate ,def -> location )));
402404
403405/*
@@ -410,7 +412,8 @@ defGetCopyOnErrorChoice(DefElem *def, ParseState *pstate, bool is_from)
410412
411413ereport (ERROR ,
412414(errcode (ERRCODE_INVALID_PARAMETER_VALUE ),
413- errmsg ("COPY ON_ERROR \"%s\" not recognized" ,sval ),
415+ /*- translator: first %s is the name of a COPY option, e.g. ON_ERROR */
416+ errmsg ("COPY %s \"%s\" not recognized" ,"ON_ERROR" ,sval ),
414417parser_errposition (pstate ,def -> location )));
415418return COPY_ON_ERROR_STOP ;/* keep compiler quiet */
416419}
@@ -434,7 +437,8 @@ defGetCopyLogVerbosityChoice(DefElem *def, ParseState *pstate)
434437
435438ereport (ERROR ,
436439(errcode (ERRCODE_INVALID_PARAMETER_VALUE ),
437- errmsg ("COPY LOG_VERBOSITY \"%s\" not recognized" ,sval ),
440+ /*- translator: first %s is the name of a COPY option, e.g. ON_ERROR */
441+ errmsg ("COPY %s \"%s\" not recognized" ,"LOG_VERBOSITY" ,sval ),
438442parser_errposition (pstate ,def -> location )));
439443return COPY_LOG_VERBOSITY_DEFAULT ;/* keep compiler quiet */
440444}
@@ -647,17 +651,18 @@ ProcessCopyOptions(ParseState *pstate,
647651if (opts_out -> binary && opts_out -> delim )
648652ereport (ERROR ,
649653(errcode (ERRCODE_SYNTAX_ERROR ),
650- errmsg ("cannot specify DELIMITER in BINARY mode" )));
654+ /*- translator: %s is the name of a COPY option, e.g. ON_ERROR */
655+ errmsg ("cannot specify %s in BINARY mode" ,"DELIMITER" )));
651656
652657if (opts_out -> binary && opts_out -> null_print )
653658ereport (ERROR ,
654659(errcode (ERRCODE_SYNTAX_ERROR ),
655- errmsg ("cannot specifyNULL in BINARY mode" )));
660+ errmsg ("cannot specify%s in BINARY mode" , "NULL " )));
656661
657662if (opts_out -> binary && opts_out -> default_print )
658663ereport (ERROR ,
659664(errcode (ERRCODE_SYNTAX_ERROR ),
660- errmsg ("cannot specifyDEFAULT in BINARY mode" )));
665+ errmsg ("cannot specify%s in BINARY mode" , "DEFAULT " )));
661666
662667if (opts_out -> binary && opts_out -> on_error != COPY_ON_ERROR_STOP )
663668ereport (ERROR ,
@@ -731,13 +736,15 @@ ProcessCopyOptions(ParseState *pstate,
731736if (opts_out -> binary && opts_out -> header_line )
732737ereport (ERROR ,
733738(errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
734- errmsg ("cannot specify HEADER in BINARY mode" )));
739+ /*- translator: %s is the name of a COPY option, e.g. ON_ERROR */
740+ errmsg ("cannot specify %s in BINARY mode" ,"HEADER" )));
735741
736742/* Check quote */
737743if (!opts_out -> csv_mode && opts_out -> quote != NULL )
738744ereport (ERROR ,
739745(errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
740- errmsg ("COPY QUOTE requires CSV mode" )));
746+ /*- translator: %s is the name of a COPY option, e.g. ON_ERROR */
747+ errmsg ("COPY %s requires CSV mode" ,"QUOTE" )));
741748
742749if (opts_out -> csv_mode && strlen (opts_out -> quote )!= 1 )
743750ereport (ERROR ,
@@ -753,7 +760,8 @@ ProcessCopyOptions(ParseState *pstate,
753760if (!opts_out -> csv_mode && opts_out -> escape != NULL )
754761ereport (ERROR ,
755762(errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
756- errmsg ("COPY ESCAPE requires CSV mode" )));
763+ /*- translator: %s is the name of a COPY option, e.g. ON_ERROR */
764+ errmsg ("COPY %s requires CSV mode" ,"ESCAPE" )));
757765
758766if (opts_out -> csv_mode && strlen (opts_out -> escape )!= 1 )
759767ereport (ERROR ,
@@ -764,71 +772,97 @@ ProcessCopyOptions(ParseState *pstate,
764772if (!opts_out -> csv_mode && (opts_out -> force_quote || opts_out -> force_quote_all ))
765773ereport (ERROR ,
766774(errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
767- errmsg ("COPY FORCE_QUOTE requires CSV mode" )));
775+ /*- translator: %s is the name of a COPY option, e.g. ON_ERROR */
776+ errmsg ("COPY %s requires CSV mode" ,"FORCE_QUOTE" )));
768777if ((opts_out -> force_quote || opts_out -> force_quote_all )&& is_from )
769778ereport (ERROR ,
770779(errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
771- errmsg ("COPY FORCE_QUOTE cannot be used with COPY FROM" )));
780+ /*- translator: first %s is the name of a COPY option, e.g. ON_ERROR,
781+ second %s is a COPY with direction, e.g. COPY TO */
782+ errmsg ("COPY %s cannot be used with %s" ,"FORCE_QUOTE" ,
783+ "COPY FROM" )));
772784
773785/* Check force_notnull */
774786if (!opts_out -> csv_mode && opts_out -> force_notnull != NIL )
775787ereport (ERROR ,
776788(errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
777- errmsg ("COPY FORCE_NOT_NULL requires CSV mode" )));
789+ /*- translator: %s is the name of a COPY option, e.g. ON_ERROR */
790+ errmsg ("COPY %s requires CSV mode" ,"FORCE_NOT_NULL" )));
778791if (opts_out -> force_notnull != NIL && !is_from )
779792ereport (ERROR ,
780793(errcode (ERRCODE_INVALID_PARAMETER_VALUE ),
781- errmsg ("COPY FORCE_NOT_NULL cannot be used with COPY TO" )));
794+ /*- translator: first %s is the name of a COPY option, e.g. ON_ERROR,
795+ second %s is a COPY with direction, e.g. COPY TO */
796+ errmsg ("COPY %s cannot be used with %s" ,"FORCE_NOT_NULL" ,
797+ "COPY TO" )));
782798
783799/* Check force_null */
784800if (!opts_out -> csv_mode && opts_out -> force_null != NIL )
785801ereport (ERROR ,
786802(errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
787- errmsg ("COPY FORCE_NULL requires CSV mode" )));
803+ /*- translator: %s is the name of a COPY option, e.g. ON_ERROR */
804+ errmsg ("COPY %s requires CSV mode" ,"FORCE_NULL" )));
788805
789806if (opts_out -> force_null != NIL && !is_from )
790807ereport (ERROR ,
791808(errcode (ERRCODE_INVALID_PARAMETER_VALUE ),
792- errmsg ("COPY FORCE_NULL cannot be used with COPY TO" )));
809+ /*- translator: first %s is the name of a COPY option, e.g. ON_ERROR,
810+ second %s is a COPY with direction, e.g. COPY TO */
811+ errmsg ("COPY %s cannot be used with %s" ,"FORCE_NULL" ,
812+ "COPY TO" )));
793813
794814/* Don't allow the delimiter to appear in the null string. */
795815if (strchr (opts_out -> null_print ,opts_out -> delim [0 ])!= NULL )
796816ereport (ERROR ,
797817(errcode (ERRCODE_INVALID_PARAMETER_VALUE ),
798- errmsg ("COPY delimiter character must not appear in the NULL specification" )));
818+ /*- translator: %s is the name of a COPY option, e.g. NULL */
819+ errmsg ("COPY delimiter character must not appear in the %s specification" ,
820+ "NULL" )));
799821
800822/* Don't allow the CSV quote char to appear in the null string. */
801823if (opts_out -> csv_mode &&
802824strchr (opts_out -> null_print ,opts_out -> quote [0 ])!= NULL )
803825ereport (ERROR ,
804826(errcode (ERRCODE_INVALID_PARAMETER_VALUE ),
805- errmsg ("CSV quote character must not appear in the NULL specification" )));
827+ /*- translator: %s is the name of a COPY option, e.g. NULL */
828+ errmsg ("CSV quote character must not appear in the %s specification" ,
829+ "NULL" )));
806830
807831/* Check freeze */
808832if (opts_out -> freeze && !is_from )
809833ereport (ERROR ,
810834(errcode (ERRCODE_INVALID_PARAMETER_VALUE ),
811- errmsg ("COPY FREEZE cannot be used with COPY TO" )));
835+ /*- translator: first %s is the name of a COPY option, e.g. ON_ERROR,
836+ second %s is a COPY with direction, e.g. COPY TO */
837+ errmsg ("COPY %s cannot be used with %s" ,"FREEZE" ,
838+ "COPY TO" )));
812839
813840if (opts_out -> default_print )
814841{
815842if (!is_from )
816843ereport (ERROR ,
817844(errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
818- errmsg ("COPY DEFAULT only available using COPY FROM" )));
845+ /*- translator: first %s is the name of a COPY option, e.g. ON_ERROR,
846+ second %s is a COPY with direction, e.g. COPY TO */
847+ errmsg ("COPY %s cannot be used with %s" ,"DEFAULT" ,
848+ "COPY TO" )));
819849
820850/* Don't allow the delimiter to appear in the default string. */
821851if (strchr (opts_out -> default_print ,opts_out -> delim [0 ])!= NULL )
822852ereport (ERROR ,
823853(errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
824- errmsg ("COPY delimiter must not appear in the DEFAULT specification" )));
854+ /*- translator: %s is the name of a COPY option, e.g. NULL */
855+ errmsg ("COPY delimiter character must not appear in the %s specification" ,
856+ "DEFAULT" )));
825857
826858/* Don't allow the CSV quote char to appear in the default string. */
827859if (opts_out -> csv_mode &&
828860strchr (opts_out -> default_print ,opts_out -> quote [0 ])!= NULL )
829861ereport (ERROR ,
830862(errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
831- errmsg ("CSV quote character must not appear in the DEFAULT specification" )));
863+ /*- translator: %s is the name of a COPY option, e.g. NULL */
864+ errmsg ("CSV quote character must not appear in the %s specification" ,
865+ "DEFAULT" )));
832866
833867/* Don't allow the NULL and DEFAULT string to be the same */
834868if (opts_out -> null_print_len == opts_out -> default_print_len &&