1 /*-------------------------------------------------------------------------
4 * rmgr descriptor routines for access/transam/multixact.c
6 * Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
11 * src/backend/access/rmgrdesc/mxactdesc.c
13 *-------------------------------------------------------------------------
17 #include "access/multixact.h"
20 out_member(StringInfo buf, MultiXactMember *member)
22 appendStringInfo(buf, "%u ", member->xid);
23 switch (member->status)
25 case MultiXactStatusForKeyShare:
26 appendStringInfoString(buf, "(keysh) ");
28 case MultiXactStatusForShare:
29 appendStringInfoString(buf, "(sh) ");
31 case MultiXactStatusForNoKeyUpdate:
32 appendStringInfoString(buf, "(fornokeyupd) ");
34 case MultiXactStatusForUpdate:
35 appendStringInfoString(buf, "(forupd) ");
37 case MultiXactStatusNoKeyUpdate:
38 appendStringInfoString(buf, "(nokeyupd) ");
40 case MultiXactStatusUpdate:
41 appendStringInfoString(buf, "(upd) ");
44 appendStringInfoString(buf, "(unk) ");
50 multixact_desc(StringInfo buf, uint8 xl_info, char *rec)
52 uint8 info = xl_info & ~XLR_INFO_MASK;
54 if (info == XLOG_MULTIXACT_ZERO_OFF_PAGE)
58 memcpy(&pageno, rec, sizeof(int));
59 appendStringInfo(buf, "zero offsets page: %d", pageno);
61 else if (info == XLOG_MULTIXACT_ZERO_MEM_PAGE)
65 memcpy(&pageno, rec, sizeof(int));
66 appendStringInfo(buf, "zero members page: %d", pageno);
68 else if (info == XLOG_MULTIXACT_CREATE_ID)
70 xl_multixact_create *xlrec = (xl_multixact_create *) rec;
73 appendStringInfo(buf, "create mxid %u offset %u nmembers %d: ", xlrec->mid,
74 xlrec->moff, xlrec->nmembers);
75 for (i = 0; i < xlrec->nmembers; i++)
76 out_member(buf, &xlrec->members[i]);
79 appendStringInfoString(buf, "UNKNOWN");