where-current-of.patch
text/x-patch
Filename: where-current-of.patch
Type: text/x-patch
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: context
| File | + | − |
|---|---|---|
| src/backend/parser/gram.y | 1 | 1 |
| src/interfaces/ecpg/preproc/ecpg.addons | 5 | 0 |
diff -dcrp postgresql.orig/src/backend/parser/gram.y postgresql/src/backend/parser/gram.y
*** postgresql.orig/src/backend/parser/gram.y 2010-10-25 16:11:35.000000000 +0200
--- postgresql/src/backend/parser/gram.y 2010-10-27 14:07:10.000000000 +0200
*************** where_clause:
*** 8389,8395 ****
/* variant for UPDATE and DELETE */
where_or_current_clause:
WHERE a_expr { $$ = $2; }
! | WHERE CURRENT_P OF name
{
CurrentOfExpr *n = makeNode(CurrentOfExpr);
/* cvarno is filled in by parse analysis */
--- 8389,8395 ----
/* variant for UPDATE and DELETE */
where_or_current_clause:
WHERE a_expr { $$ = $2; }
! | WHERE CURRENT_P OF cursor_name
{
CurrentOfExpr *n = makeNode(CurrentOfExpr);
/* cvarno is filled in by parse analysis */
diff -dcrp postgresql.orig/src/interfaces/ecpg/preproc/ecpg.addons postgresql/src/interfaces/ecpg/preproc/ecpg.addons
*** postgresql.orig/src/interfaces/ecpg/preproc/ecpg.addons 2010-09-21 13:49:59.000000000 +0200
--- postgresql/src/interfaces/ecpg/preproc/ecpg.addons 2010-10-27 14:11:21.000000000 +0200
*************** ECPG: stmtViewStmt rule
*** 192,197 ****
--- 192,202 ----
output_simple_statement($1);
}
+ ECPG: where_or_current_clauseWHERECURRENT_POFcursor_name block
+ {
+ char *cursor_marker = $4[0] == ':' ? make_str("$0") : $4;
+ $$ = cat_str(2,make_str("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");