summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2003-08-13 16:16:23 +0000
committerTom Lane2003-08-13 16:16:23 +0000
commit5be44fa453df96aecfa5eb717553e8264700db18 (patch)
treeb71accba00dfeda10a0354907e689e8ddcc55221
parent364ef5148495f2b7d656aa04643c61737510b66c (diff)
Move MemoryContextCheck() call from bottom of PostgresMain loop to
just before CommitTransactionCommand(). This is a more sensible place to put it since commit discards a lot of contexts, and we'd not find out about stomps affecting only transaction-local contexts.
-rw-r--r--src/backend/tcop/postgres.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index b8f06a69b33..6f4676149fc 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.359 2003/08/12 18:52:38 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.360 2003/08/13 16:16:23 tgl Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
@@ -1753,6 +1753,11 @@ finish_xact_command(void)
/* Cancel any active statement timeout before committing */
disable_sig_alarm(true);
+#ifdef MEMORY_CONTEXT_CHECKING
+ /* Check memory before committing (since commit discards much) */
+ MemoryContextCheck(TopMemoryContext);
+#endif
+
/* Now commit the command */
ereport(DEBUG3,
(errmsg_internal("CommitTransactionCommand")));
@@ -1760,7 +1765,7 @@ finish_xact_command(void)
CommitTransactionCommand();
#ifdef SHOW_MEMORY_STATS
- /* Print mem stats at each commit for leak tracking */
+ /* Print mem stats after each commit for leak tracking */
if (ShowStats)
MemoryContextStats(TopMemoryContext);
#endif
@@ -2646,7 +2651,7 @@ PostgresMain(int argc, char *argv[], const char *username)
if (!IsUnderPostmaster)
{
puts("\nPOSTGRES backend interactive interface ");
- puts("$Revision: 1.359 $ $Date: 2003/08/12 18:52:38 $\n");
+ puts("$Revision: 1.360 $ $Date: 2003/08/13 16:16:23 $\n");
}
/*
@@ -3063,15 +3068,6 @@ PostgresMain(int argc, char *argv[], const char *username)
errmsg("invalid frontend message type %d",
firstchar)));
}
-
-#ifdef MEMORY_CONTEXT_CHECKING
-
- /*
- * Check all memory after each backend loop. This is a rather
- * weird place to do it, perhaps.
- */
- MemoryContextCheck(TopMemoryContext);
-#endif
} /* end of input-reading loop */
/* can't get here because the above loop never exits */