aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/execMain.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-11-30 20:51:25 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-11-30 20:51:25 +0000
commitc1f3073333d01987ac9c3e5f6c197b9e2afc3ba9 (patch)
treeb70ddff5404c442ec13a5c182346984d4300f6da /src/backend/executor/execMain.c
parent3f936aacc057e4b391ab953fea2ffb689a12a8bc (diff)
downloadpostgresql-c1f3073333d01987ac9c3e5f6c197b9e2afc3ba9.tar.gz
postgresql-c1f3073333d01987ac9c3e5f6c197b9e2afc3ba9.zip
Clean up the API for DestReceiver objects by eliminating the assumption
that a Portal is a useful and sufficient additional argument for CreateDestReceiver --- it just isn't, in most cases. Instead formalize the approach of passing any needed parameters to the receiver separately. One unexpected benefit of this change is that we can declare typedef Portal in a less surprising location. This patch is just code rearrangement and doesn't change any functionality. I'll tackle the HOLD-cursor-vs-toast problem in a follow-on patch.
Diffstat (limited to 'src/backend/executor/execMain.c')
-rw-r--r--src/backend/executor/execMain.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index f63ea4e9eba..cb83e86e7bf 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -26,7 +26,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.318 2008/11/19 01:10:23 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.319 2008/11/30 20:51:25 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -2833,7 +2833,7 @@ OpenIntoRel(QueryDesc *queryDesc)
/*
* Now replace the query's DestReceiver with one for SELECT INTO
*/
- queryDesc->dest = CreateDestReceiver(DestIntoRel, NULL);
+ queryDesc->dest = CreateDestReceiver(DestIntoRel);
myState = (DR_intorel *) queryDesc->dest;
Assert(myState->pub.mydest == DestIntoRel);
myState->estate = estate;
@@ -2877,10 +2877,6 @@ CloseIntoRel(QueryDesc *queryDesc)
/*
* CreateIntoRelDestReceiver -- create a suitable DestReceiver object
- *
- * Since CreateDestReceiver doesn't accept the parameters we'd need,
- * we just leave the private fields zeroed here. OpenIntoRel will
- * fill them in.
*/
DestReceiver *
CreateIntoRelDestReceiver(void)
@@ -2893,6 +2889,8 @@ CreateIntoRelDestReceiver(void)
self->pub.rDestroy = intorel_destroy;
self->pub.mydest = DestIntoRel;
+ /* private fields will be set by OpenIntoRel */
+
return (DestReceiver *) self;
}