From a9545b3aef0d41fdb84bc6a30fa2e563020acad2 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 11 Jun 2007 22:22:42 +0000 Subject: 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. --- src/include/nodes/primnodes.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/include/nodes/primnodes.h') diff --git a/src/include/nodes/primnodes.h b/src/include/nodes/primnodes.h index 9a3e09b77e..cdcd4d5caa 100644 --- a/src/include/nodes/primnodes.h +++ b/src/include/nodes/primnodes.h @@ -10,7 +10,7 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/nodes/primnodes.h,v 1.131 2007/06/11 01:16:30 tgl Exp $ + * $PostgreSQL: pgsql/src/include/nodes/primnodes.h,v 1.132 2007/06/11 22:22:42 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -922,12 +922,17 @@ typedef struct SetToDefault * of the target relation being constrained; this aids placing the expression * correctly during planning. We can assume however that its "levelsup" is * always zero, due to the syntactic constraints on where it can appear. + * + * The referenced cursor can be represented either as a hardwired string + * or as a reference to a run-time parameter of type REFCURSOR. The latter + * case is for the convenience of plpgsql. */ typedef struct CurrentOfExpr { Expr xpr; Index cvarno; /* RT index of target relation */ - char *cursor_name; /* name of referenced cursor */ + char *cursor_name; /* name of referenced cursor, or NULL */ + int cursor_param; /* refcursor parameter number, or 0 */ } CurrentOfExpr; /*-------------------- -- cgit v1.2.1