mirror of
https://github.com/postgres/postgres.git
synced 2025-08-14 02:22:38 +03:00
Improve UPDATE/DELETE WHERE CURRENT OF so that they can be used from plpgsql
with a plpgsql-defined cursor. The underlying mechanism for this is that the main SQL engine will now take "WHERE CURRENT OF $n" where $n is a refcursor parameter. Not sure if we should document that fact or consider it an implementation detail. Per discussion with Pavel Stehule.
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.260 2007/06/11 01:16:29 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.261 2007/06/11 22:22:42 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -4136,8 +4136,16 @@ get_rule_expr(Node *node, deparse_context *context,
|
||||
break;
|
||||
|
||||
case T_CurrentOfExpr:
|
||||
appendStringInfo(buf, "CURRENT OF %s",
|
||||
quote_identifier(((CurrentOfExpr *) node)->cursor_name));
|
||||
{
|
||||
CurrentOfExpr *cexpr = (CurrentOfExpr *) node;
|
||||
|
||||
if (cexpr->cursor_name)
|
||||
appendStringInfo(buf, "CURRENT OF %s",
|
||||
quote_identifier(cexpr->cursor_name));
|
||||
else
|
||||
appendStringInfo(buf, "CURRENT OF $%d",
|
||||
cexpr->cursor_param);
|
||||
}
|
||||
break;
|
||||
|
||||
case T_List:
|
||||
|
Reference in New Issue
Block a user