Age Owner TLA Line data Source code
1 : /*-------------------------------------------------------------------------
2 : *
3 : * tblspcdesc.c
4 : * rmgr descriptor routines for commands/tablespace.c
5 : *
6 : * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
7 : * Portions Copyright (c) 1994, Regents of the University of California
8 : *
9 : *
10 : * IDENTIFICATION
11 : * src/backend/access/rmgrdesc/tblspcdesc.c
12 : *
13 : *-------------------------------------------------------------------------
14 : */
15 : #include "postgres.h"
16 :
17 : #include "commands/tablespace.h"
18 :
19 :
20 : void
3062 heikki.linnakangas 21 CBC 8 : tblspc_desc(StringInfo buf, XLogReaderState *record)
22 : {
3221 23 8 : char *rec = XLogRecGetData(record);
3062 24 8 : uint8 info = XLogRecGetInfo(record) & ~XLR_INFO_MASK;
25 :
3784 alvherre 26 8 : if (info == XLOG_TBLSPC_CREATE)
27 : {
3784 alvherre 28 UBC 0 : xl_tblspc_create_rec *xlrec = (xl_tblspc_create_rec *) rec;
29 :
3124 andres 30 0 : appendStringInfo(buf, "%u \"%s\"", xlrec->ts_id, xlrec->ts_path);
31 : }
3784 alvherre 32 CBC 8 : else if (info == XLOG_TBLSPC_DROP)
33 : {
34 8 : xl_tblspc_drop_rec *xlrec = (xl_tblspc_drop_rec *) rec;
35 :
3124 andres 36 8 : appendStringInfo(buf, "%u", xlrec->ts_id);
37 : }
38 8 : }
39 :
40 : const char *
41 8 : tblspc_identify(uint8 info)
42 : {
43 8 : const char *id = NULL;
44 :
3121 45 8 : switch (info & ~XLR_INFO_MASK)
46 : {
3124 andres 47 UBC 0 : case XLOG_TBLSPC_CREATE:
48 0 : id = "CREATE";
49 0 : break;
3124 andres 50 CBC 8 : case XLOG_TBLSPC_DROP:
51 8 : id = "DROP";
52 8 : break;
53 : }
54 :
55 8 : return id;
56 : }
|