]> granicus.if.org Git - postgresql/blob - src/backend/access/rmgrdesc/clogdesc.c
Update copyrights for 2013
[postgresql] / src / backend / access / rmgrdesc / clogdesc.c
1 /*-------------------------------------------------------------------------
2  *
3  * clogdesc.c
4  *    rmgr descriptor routines for access/transam/clog.c
5  *
6  * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  *
10  * IDENTIFICATION
11  *    src/backend/access/rmgrdesc/clogdesc.c
12  *
13  *-------------------------------------------------------------------------
14  */
15 #include "postgres.h"
16
17 #include "access/clog.h"
18
19
20 void
21 clog_desc(StringInfo buf, uint8 xl_info, char *rec)
22 {
23         uint8           info = xl_info & ~XLR_INFO_MASK;
24
25         if (info == CLOG_ZEROPAGE)
26         {
27                 int                     pageno;
28
29                 memcpy(&pageno, rec, sizeof(int));
30                 appendStringInfo(buf, "zeropage: %d", pageno);
31         }
32         else if (info == CLOG_TRUNCATE)
33         {
34                 int                     pageno;
35
36                 memcpy(&pageno, rec, sizeof(int));
37                 appendStringInfo(buf, "truncate before: %d", pageno);
38         }
39         else
40                 appendStringInfo(buf, "UNKNOWN");
41 }