Header And Logo

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

dbasedesc.c

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  * dbasedesc.c
00004  *    rmgr descriptor routines for commands/dbcommands.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/dbasedesc.c
00012  *
00013  *-------------------------------------------------------------------------
00014  */
00015 #include "postgres.h"
00016 
00017 #include "commands/dbcommands.h"
00018 #include "lib/stringinfo.h"
00019 
00020 
00021 void
00022 dbase_desc(StringInfo buf, uint8 xl_info, char *rec)
00023 {
00024     uint8       info = xl_info & ~XLR_INFO_MASK;
00025 
00026     if (info == XLOG_DBASE_CREATE)
00027     {
00028         xl_dbase_create_rec *xlrec = (xl_dbase_create_rec *) rec;
00029 
00030         appendStringInfo(buf, "create db: copy dir %u/%u to %u/%u",
00031                          xlrec->src_db_id, xlrec->src_tablespace_id,
00032                          xlrec->db_id, xlrec->tablespace_id);
00033     }
00034     else if (info == XLOG_DBASE_DROP)
00035     {
00036         xl_dbase_drop_rec *xlrec = (xl_dbase_drop_rec *) rec;
00037 
00038         appendStringInfo(buf, "drop db: dir %u/%u",
00039                          xlrec->db_id, xlrec->tablespace_id);
00040     }
00041     else
00042         appendStringInfo(buf, "UNKNOWN");
00043 }