1 /*-------------------------------------------------------------------------
4 * rmgr descriptor routines for storage/ipc/standby.c
6 * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
11 * src/backend/access/rmgrdesc/standbydesc.c
13 *-------------------------------------------------------------------------
17 #include "storage/standby.h"
20 standby_desc_running_xacts(StringInfo buf, xl_running_xacts *xlrec)
24 appendStringInfo(buf, " nextXid %u latestCompletedXid %u oldestRunningXid %u",
26 xlrec->latestCompletedXid,
27 xlrec->oldestRunningXid);
30 appendStringInfo(buf, "; %d xacts:", xlrec->xcnt);
31 for (i = 0; i < xlrec->xcnt; i++)
32 appendStringInfo(buf, " %u", xlrec->xids[i]);
35 if (xlrec->subxid_overflow)
36 appendStringInfo(buf, "; subxid ovf");
40 standby_desc(StringInfo buf, uint8 xl_info, char *rec)
42 uint8 info = xl_info & ~XLR_INFO_MASK;
44 if (info == XLOG_STANDBY_LOCK)
46 xl_standby_locks *xlrec = (xl_standby_locks *) rec;
49 appendStringInfo(buf, "AccessExclusive locks:");
51 for (i = 0; i < xlrec->nlocks; i++)
52 appendStringInfo(buf, " xid %u db %u rel %u",
53 xlrec->locks[i].xid, xlrec->locks[i].dbOid,
54 xlrec->locks[i].relOid);
56 else if (info == XLOG_RUNNING_XACTS)
58 xl_running_xacts *xlrec = (xl_running_xacts *) rec;
60 appendStringInfo(buf, "running xacts:");
61 standby_desc_running_xacts(buf, xlrec);
64 appendStringInfo(buf, "UNKNOWN");