Header And Logo

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

tblspcdesc.c

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  * tblspcdesc.c
00004  *    rmgr descriptor routines for commands/tablespace.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/tblspcdesc.c
00012  *
00013  *-------------------------------------------------------------------------
00014  */
00015 #include "postgres.h"
00016 
00017 #include "commands/tablespace.h"
00018 
00019 
00020 void
00021 tblspc_desc(StringInfo buf, uint8 xl_info, char *rec)
00022 {
00023     uint8       info = xl_info & ~XLR_INFO_MASK;
00024 
00025     if (info == XLOG_TBLSPC_CREATE)
00026     {
00027         xl_tblspc_create_rec *xlrec = (xl_tblspc_create_rec *) rec;
00028 
00029         appendStringInfo(buf, "create tablespace: %u \"%s\"",
00030                          xlrec->ts_id, xlrec->ts_path);
00031     }
00032     else if (info == XLOG_TBLSPC_DROP)
00033     {
00034         xl_tblspc_drop_rec *xlrec = (xl_tblspc_drop_rec *) rec;
00035 
00036         appendStringInfo(buf, "drop tablespace: %u", xlrec->ts_id);
00037     }
00038     else
00039         appendStringInfo(buf, "UNKNOWN");
00040 }