summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFujii Masao2025-01-14 16:23:02 +0000
committerFujii Masao2025-01-14 16:23:02 +0000
commit94b914f601bd15829df6f83c0246342ca92630b1 (patch)
tree28319815af627dbbae41b4f7e364505a49e246ab
parent4cb560b53f8f9e9a94d593f9416c107ed8202110 (diff)
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.addons2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/interfaces/ecpg/preproc/ecpg.addons b/src/interfaces/ecpg/preproc/ecpg.addons
index 71f7ad26ad8..b732f1a3551 100644
--- a/src/interfaces/ecpg/preproc/ecpg.addons
+++ b/src/interfaces/ecpg/preproc/ecpg.addons
@@ -240,7 +240,7 @@ ECPG: block where_or_current_clause WHERE CURRENT_P OF cursor_name
@$ = cat_str(2, "where current of", cursor_marker);
}
ECPG: addon CopyStmt COPY opt_binary qualified_name opt_column_list copy_from opt_program copy_file_name copy_delimiter opt_with copy_options where_clause
- 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: addon var_value NumericOnly