From 3f8db37c2f1eeeffd9dae3189b783a463f56fe77 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 12 Aug 2006 20:05:56 +0000 Subject: Tweak SPI_cursor_open to allow INSERT/UPDATE/DELETE RETURNING; this was merely a matter of fixing the error check, since the underlying Portal infrastructure already handles it. This in turn allows these statements to be used in some existing plpgsql and plperl contexts, such as a plpgsql FOR loop. Also, do some marginal code cleanup in places that were being sloppy about distinguishing SELECT from SELECT INTO. --- src/backend/executor/execMain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/backend/executor/execMain.c') diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c index 05c4a542b8..4b8a166ffa 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.278 2006/08/12 02:52:04 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.279 2006/08/12 20:05:55 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -497,7 +497,7 @@ InitPlan(QueryDesc *queryDesc, int eflags) /* * if there is a result relation, initialize result relation stuff */ - if (parseTree->resultRelation != 0 && operation != CMD_SELECT) + if (parseTree->resultRelation) { List *resultRelations = parseTree->resultRelations; int numResultRelations; -- cgit v1.2.1