Skip to content

Commit 0a4fe8a

Browse files
committed
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.
1 parent 8337e3b commit 0a4fe8a

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/interfaces/ecpg/preproc/ecpg.addons

+2-8
Original file line numberDiff line numberDiff line change
@@ -193,15 +193,9 @@ ECPG: where_or_current_clauseWHERECURRENT_POFcursor_name block
193193
$$ = cat_str(2,mm_strdup("where current of"), cursor_marker);
194194
}
195195
ECPG: CopyStmtCOPYopt_binaryqualified_nameopt_column_listopt_oidscopy_fromcopy_file_namecopy_delimiteropt_withcopy_options addon
196-
if (strcmp($6, "to") == 0 && strcmp($7, "stdin") == 0)
197-
mmerror(PARSE_ERROR, ET_ERROR, "COPY TO STDIN is not possible");
198-
else if (strcmp($6, "from") == 0 && strcmp($7, "stdout") == 0)
199-
mmerror(PARSE_ERROR, ET_ERROR, "COPY FROM STDOUT is not possible");
200-
else if (strcmp($6, "from") == 0 && strcmp($7, "stdin") == 0)
196+
if (strcmp($6, "from") == 0 &&
197+
(strcmp($7, "stdin") == 0 || strcmp($7, "stdout") == 0))
201198
mmerror(PARSE_ERROR, ET_WARNING, "COPY FROM STDIN is not implemented");
202-
ECPG: CopyStmtCOPYselect_with_parensTOcopy_file_nameopt_withcopy_options addon
203-
if (strcmp($4, "stdin") == 0)
204-
mmerror(PARSE_ERROR, ET_ERROR, "COPY TO STDIN is not possible");
205199
ECPG: var_valueNumericOnly addon
206200
if ($1[0] == '$')
207201
{

0 commit comments

Comments
 (0)