diff options
author | Fujii Masao <fujii@postgresql.org> | 2025-01-15 01:24:24 +0900 |
---|---|---|
committer | Fujii Masao <fujii@postgresql.org> | 2025-01-15 01:25:19 +0900 |
commit | 71ef47cf0f20e680319e866220e05c208b3e2bd8 (patch) | |
tree | 3d8783fe0cb3ab50a751fc9fdb272add5b288aa3 | |
parent | ce7c406f0f8d562e856d43a7e1feb82043f772bc (diff) | |
download | postgresql-71ef47cf0f20e680319e866220e05c208b3e2bd8.tar.gz postgresql-71ef47cf0f20e680319e866220e05c208b3e2bd8.zip |
ecpg: Restore detection of unsupported COPY FROM STDIN.
The ecpg command includes code to warn about unsupported COPY FROM STDIN
statements in input files. However, since commit 3d009e45bd,
this functionality has been broken due to a bug introduced in that commit,
causing ecpg to fail to detect the statement.
This commit resolves the issue, restoring ecpg's ability to detect
COPY FROM STDIN and issue a warning as intended.
Back-patch to all supported versions.
Author: Ryo Kanbayashi
Reviewed-by: Hayato Kuroda, Tom Lane
Discussion: https://postgr.es/m/CANOn0Ez_t5uDCUEV8c1YORMisJiU5wu681eEVZzgKwOeiKhkqQ@mail.gmail.com
-rw-r--r-- | src/interfaces/ecpg/preproc/ecpg.addons | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/interfaces/ecpg/preproc/ecpg.addons b/src/interfaces/ecpg/preproc/ecpg.addons index 94f7d4a3ec2..4bb4b9ead73 100644 --- a/src/interfaces/ecpg/preproc/ecpg.addons +++ b/src/interfaces/ecpg/preproc/ecpg.addons @@ -248,7 +248,7 @@ ECPG: where_or_current_clauseWHERECURRENT_POFcursor_name block $$ = cat_str(2,mm_strdup("where current of"), cursor_marker); } ECPG: CopyStmtCOPYopt_binaryqualified_nameopt_column_listcopy_fromopt_programcopy_file_namecopy_delimiteropt_withcopy_optionswhere_clause addon - if (strcmp($6, "from") == 0 && + if (strcmp($5, "from") == 0 && (strcmp($7, "stdin") == 0 || strcmp($7, "stdout") == 0)) mmerror(PARSE_ERROR, ET_WARNING, "COPY FROM STDIN is not implemented"); ECPG: var_valueNumericOnly addon |