Header And Logo

PostgreSQL
| The world's most advanced open source database.

clogdesc.c

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  * clogdesc.c
00004  *    rmgr descriptor routines for access/transam/clog.c
00005  *
00006  * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
00007  * Portions Copyright (c) 1994, Regents of the University of California
00008  *
00009  *
00010  * IDENTIFICATION
00011  *    src/backend/access/rmgrdesc/clogdesc.c
00012  *
00013  *-------------------------------------------------------------------------
00014  */
00015 #include "postgres.h"
00016 
00017 #include "access/clog.h"
00018 
00019 
00020 void
00021 clog_desc(StringInfo buf, uint8 xl_info, char *rec)
00022 {
00023     uint8       info = xl_info & ~XLR_INFO_MASK;
00024 
00025     if (info == CLOG_ZEROPAGE)
00026     {
00027         int         pageno;
00028 
00029         memcpy(&pageno, rec, sizeof(int));
00030         appendStringInfo(buf, "zeropage: %d", pageno);
00031     }
00032     else if (info == CLOG_TRUNCATE)
00033     {
00034         int         pageno;
00035 
00036         memcpy(&pageno, rec, sizeof(int));
00037         appendStringInfo(buf, "truncate before: %d", pageno);
00038     }
00039     else
00040         appendStringInfo(buf, "UNKNOWN");
00041 }