1 /*-------------------------------------------------------------------------
4 * rmgr descriptor routines for catalog/storage.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/smgrdesc.c
13 *-------------------------------------------------------------------------
17 #include "catalog/catalog.h"
18 #include "catalog/storage_xlog.h"
22 smgr_desc(StringInfo buf, uint8 xl_info, char *rec)
24 uint8 info = xl_info & ~XLR_INFO_MASK;
26 if (info == XLOG_SMGR_CREATE)
28 xl_smgr_create *xlrec = (xl_smgr_create *) rec;
29 char *path = relpathperm(xlrec->rnode, xlrec->forkNum);
31 appendStringInfo(buf, "file create: %s", path);
34 else if (info == XLOG_SMGR_TRUNCATE)
36 xl_smgr_truncate *xlrec = (xl_smgr_truncate *) rec;
37 char *path = relpathperm(xlrec->rnode, MAIN_FORKNUM);
39 appendStringInfo(buf, "file truncate: %s to %u blocks", path,
44 appendStringInfoString(buf, "UNKNOWN");