aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-02-27 19:36:13 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-02-27 19:36:13 +0000
commit6779c55c228ba5904dc767a7882b47a2b4c74ff7 (patch)
tree27a1df60ccf81098405bd477d653da6edebce6c0 /src/backend/tcop/postgres.c
parente22c9c44756da85bf1e453f83bf260c9e5ef5813 (diff)
downloadpostgresql-6779c55c228ba5904dc767a7882b47a2b4c74ff7.tar.gz
postgresql-6779c55c228ba5904dc767a7882b47a2b4c74ff7.zip
Clean up BeginCommand and related routines. BeginCommand and EndCommand
are now both invoked once per received SQL command (raw parsetree) from pg_exec_query_string. BeginCommand is actually just an empty routine at the moment --- all its former operations have been pushed into tuple receiver setup routines in printtup.c. This makes for a clean distinction between BeginCommand/EndCommand (once per command) and the tuple receiver setup/teardown routines (once per ExecutorRun call), whereas the old code was quite ad hoc. Along the way, clean up the calling conventions for ExecutorRun a little bit.
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r--src/backend/tcop/postgres.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index 61fdf9c5acf..cfaaf556dd0 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.248 2002/02/26 22:47:08 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.249 2002/02/27 19:35:12 tgl Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
@@ -646,6 +646,18 @@ pg_exec_query_string(char *query_string, /* string to execute */
isTransactionStmt = IsA(parsetree, TransactionStmt);
/*
+ * First we set the command-completion tag to the main query
+ * (as opposed to each of the others that may be generated by
+ * analyze and rewrite). Also set ps_status and do any special
+ * start-of-SQL-command processing needed by the destination.
+ */
+ commandTag = CreateCommandTag(parsetree);
+
+ set_ps_display(commandTag);
+
+ BeginCommand(commandTag, dest);
+
+ /*
* If we are in an aborted transaction, ignore all commands except
* COMMIT/ABORT. It is important that this test occur before we
* try to do parse analysis, rewrite, or planning, since all those
@@ -707,18 +719,7 @@ pg_exec_query_string(char *query_string, /* string to execute */
/*
* OK to analyze and rewrite this query.
- */
-
- /*
- * First we set the command-completion tag to the main query
- * (as opposed to each of the others that may be generated by
- * analyze and rewrite). Also set ps_status to the main query tag.
- */
- commandTag = CreateCommandTag(parsetree);
-
- set_ps_display(commandTag);
-
- /*
+ *
* Switch to appropriate context for constructing querytrees (again,
* these must outlive the execution context).
*/
@@ -1688,7 +1689,7 @@ PostgresMain(int argc, char *argv[], const char *username)
if (!IsUnderPostmaster)
{
puts("\nPOSTGRES backend interactive interface ");
- puts("$Revision: 1.248 $ $Date: 2002/02/26 22:47:08 $\n");
+ puts("$Revision: 1.249 $ $Date: 2002/02/27 19:35:12 $\n");
}
/*