aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-08-28 18:18:03 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-08-28 18:18:03 +0000
commitf444dafab0c449bbb3c79683d4488e1ac4978f71 (patch)
tree5c3551e8860ba984863ff8deef59ccd7d2cf1446 /src
parent7ff1c9d974f09035a22441151d8be1d0c9a27ff6 (diff)
downloadpostgresql-f444dafab0c449bbb3c79683d4488e1ac4978f71.tar.gz
postgresql-f444dafab0c449bbb3c79683d4488e1ac4978f71.zip
Can't truncate pg_subtrans during a recovery checkpoint --- subtrans
module isn't fully initialized yet.
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/transam/xlog.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 5c07795c8a9..32380eeb37b 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.163 2004/08/23 23:22:44 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.164 2004/08/28 18:18:03 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -4922,9 +4922,11 @@ CreateCheckPoint(bool shutdown, bool force)
* Truncate pg_subtrans if possible. We can throw away all data before
* the oldest XMIN of any running transaction. No future transaction will
* attempt to reference any pg_subtrans entry older than that (see Asserts
- * in subtrans.c).
+ * in subtrans.c). During recovery, though, we mustn't do this because
+ * StartupSUBTRANS hasn't been called yet.
*/
- TruncateSUBTRANS(GetOldestXmin(true));
+ if (!InRecovery)
+ TruncateSUBTRANS(GetOldestXmin(true));
LWLockRelease(CheckpointLock);
}