aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/utility.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-08-02 01:30:51 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-08-02 01:30:51 +0000
commitf622c5404905cb998adabe3a3527f7e9cdace229 (patch)
treebc65d3f7d71a9a8c09945e7072bbca2baeb937a3 /src/backend/tcop/utility.c
parent410b1dfb885f5b6d60f89003baba32a4efe93225 (diff)
downloadpostgresql-f622c5404905cb998adabe3a3527f7e9cdace229.tar.gz
postgresql-f622c5404905cb998adabe3a3527f7e9cdace229.zip
Allow DECLARE CURSOR to take parameters from the portal in which it is
executed. Previously, the DECLARE would succeed but subsequent FETCHes would fail since the parameter values supplied to DECLARE were not propagated to the portal created for the cursor. In support of this, add type Oids to ParamListInfo entries, which seems like a good idea anyway since code that extracts a value can double-check that it got the type of value it was expecting. Oliver Jowett, with minor editorialization by Tom Lane.
Diffstat (limited to 'src/backend/tcop/utility.c')
-rw-r--r--src/backend/tcop/utility.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c
index d8d718a1823..b9c50d7d81c 100644
--- a/src/backend/tcop/utility.c
+++ b/src/backend/tcop/utility.c
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/tcop/utility.c,v 1.222 2004/08/01 17:32:18 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/tcop/utility.c,v 1.223 2004/08/02 01:30:45 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -294,6 +294,7 @@ check_xact_readonly(Node *parsetree)
* general utility function invoker
*
* parsetree: the parse tree for the utility statement
+ * params: parameters to use during execution (currently only used by DECLARE)
* dest: where to send results
* completionTag: points to a buffer of size COMPLETION_TAG_BUFSIZE
* in which to store a command completion status string.
@@ -305,6 +306,7 @@ check_xact_readonly(Node *parsetree)
*/
void
ProcessUtility(Node *parsetree,
+ ParamListInfo params,
DestReceiver *dest,
char *completionTag)
{
@@ -406,7 +408,7 @@ ProcessUtility(Node *parsetree,
* Portal (cursor) manipulation
*/
case T_DeclareCursorStmt:
- PerformCursorOpen((DeclareCursorStmt *) parsetree);
+ PerformCursorOpen((DeclareCursorStmt *) parsetree, params);
break;
case T_ClosePortalStmt: