summaryrefslogtreecommitdiff
path: root/src/backend/parser
diff options
context:
space:
mode:
authorTom Lane2003-05-02 20:54:36 +0000
committerTom Lane2003-05-02 20:54:36 +0000
commitde28dc9a04c4df5d711815b7a518501b43535a26 (patch)
tree1b93363ece14ded804195ff4a1c754a9b4a32306 /src/backend/parser
parent1940434f1ef8475c8b59bb8ff03e3f3a10cac6ae (diff)
Portal and memory management infrastructure for extended query protocol.
Both plannable queries and utility commands are now always executed within Portals, which have been revamped so that they can handle the load (they used to be good only for single SELECT queries). Restructure code to push command-completion-tag selection logic out of postgres.c, so that it won't have to be duplicated between simple and extended queries. initdb forced due to addition of a field to Query nodes.
Diffstat (limited to 'src/backend/parser')
-rw-r--r--src/backend/parser/analyze.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c
index c2159a70e0e..a488d1d91e5 100644
--- a/src/backend/parser/analyze.c
+++ b/src/backend/parser/analyze.c
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.268 2003/04/29 22:13:09 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.269 2003/05/02 20:54:34 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -237,13 +237,23 @@ do_parse_analyze(Node *parseTree, ParseState *pstate)
/*
* Make sure that only the original query is marked original. We have
* to do this explicitly since recursive calls of do_parse_analyze will
- * have marked some of the added-on queries as "original".
+ * have marked some of the added-on queries as "original". Also mark
+ * only the original query as allowed to set the command-result tag.
*/
foreach(listscan, result)
{
Query *q = lfirst(listscan);
- q->querySource = (q == query ? QSRC_ORIGINAL : QSRC_PARSER);
+ if (q == query)
+ {
+ q->querySource = QSRC_ORIGINAL;
+ q->canSetTag = true;
+ }
+ else
+ {
+ q->querySource = QSRC_PARSER;
+ q->canSetTag = false;
+ }
}
return result;
@@ -399,6 +409,11 @@ transformStmt(ParseState *pstate, Node *parseTree,
result->utilityStmt = (Node *) parseTree;
break;
}
+
+ /* Mark as original query until we learn differently */
+ result->querySource = QSRC_ORIGINAL;
+ result->canSetTag = true;
+
return result;
}