1 /*-------------------------------------------------------------------------
4 * rmgr descriptor routines for catalog/storage.c
6 * Portions Copyright (c) 1996-2022, 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/storage_xlog.h"
21 smgr_desc(StringInfo buf
, XLogReaderState
*record
)
23 char *rec
= XLogRecGetData(record
);
24 uint8 info
= XLogRecGetInfo(record
) & ~XLR_INFO_MASK
;
26 if (info
== XLOG_SMGR_CREATE
)
28 xl_smgr_create
*xlrec
= (xl_smgr_create
*) rec
;
29 char *path
= relpathperm(xlrec
->rlocator
, xlrec
->forkNum
);
31 appendStringInfoString(buf
, path
);
34 else if (info
== XLOG_SMGR_TRUNCATE
)
36 xl_smgr_truncate
*xlrec
= (xl_smgr_truncate
*) rec
;
37 char *path
= relpathperm(xlrec
->rlocator
, MAIN_FORKNUM
);
39 appendStringInfo(buf
, "%s to %u blocks flags %d", path
,
40 xlrec
->blkno
, xlrec
->flags
);
46 smgr_identify(uint8 info
)
48 const char *id
= NULL
;
50 switch (info
& ~XLR_INFO_MASK
)
52 case XLOG_SMGR_CREATE
:
55 case XLOG_SMGR_TRUNCATE
: