summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2013-02-26 19:30:15 +0200
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2013-02-26 19:33:15 +0200
commit0a4fe8a318ed37556dd019def073ccd956645e27 (patch)
treef0769f09bcf466ce56792ed1d56fd292a8ccdad6 /src
parent8337e3b4575b1588462c2d74135516fd22f60942 (diff)
downloadpostgresql-0a4fe8a318ed37556dd019def073ccd956645e27.tar.gz
Remove the check for COPY TO STDIN and COPY FROM STDOUT from ecpg.
The backend grammar treats STDIN and STDOUT completely interchangeable, so that the above accepted. Arguably that was a mistake the backend grammar, but it's not ecpg's business to second guess that.
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/ecpg/preproc/ecpg.addons10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/interfaces/ecpg/preproc/ecpg.addons b/src/interfaces/ecpg/preproc/ecpg.addons
index aae3cc9d92..d8147cf43c 100644
--- a/src/interfaces/ecpg/preproc/ecpg.addons
+++ b/src/interfaces/ecpg/preproc/ecpg.addons
@@ -193,15 +193,9 @@ ECPG: where_or_current_clauseWHERECURRENT_POFcursor_name block
$$ = cat_str(2,mm_strdup("where current of"), cursor_marker);
}
ECPG: CopyStmtCOPYopt_binaryqualified_nameopt_column_listopt_oidscopy_fromcopy_file_namecopy_delimiteropt_withcopy_options addon
- if (strcmp($6, "to") == 0 && strcmp($7, "stdin") == 0)
- mmerror(PARSE_ERROR, ET_ERROR, "COPY TO STDIN is not possible");
- else if (strcmp($6, "from") == 0 && strcmp($7, "stdout") == 0)
- mmerror(PARSE_ERROR, ET_ERROR, "COPY FROM STDOUT is not possible");
- else if (strcmp($6, "from") == 0 && strcmp($7, "stdin") == 0)
+ if (strcmp($6, "from") == 0 &&
+ (strcmp($7, "stdin") == 0 || strcmp($7, "stdout") == 0))
mmerror(PARSE_ERROR, ET_WARNING, "COPY FROM STDIN is not implemented");
-ECPG: CopyStmtCOPYselect_with_parensTOcopy_file_nameopt_withcopy_options addon
- if (strcmp($4, "stdin") == 0)
- mmerror(PARSE_ERROR, ET_ERROR, "COPY TO STDIN is not possible");
ECPG: var_valueNumericOnly addon
if ($1[0] == '$')
{