Age Owner Branch data TLA Line data Source code
1 : : /*-------------------------------------------------------------------------
2 : : *
3 : : * tblspcdesc.c
4 : : * rmgr descriptor routines for commands/tablespace.c
5 : : *
6 : : * Portions Copyright (c) 1996-2026, 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
4184 heikki.linnakangas@i 21 :CBC 36 : tblspc_desc(StringInfo buf, XLogReaderState *record)
22 : : {
4343 23 : 36 : char *rec = XLogRecGetData(record);
4184 24 : 36 : uint8 info = XLogRecGetInfo(record) & ~XLR_INFO_MASK;
25 : :
4906 alvherre@alvh.no-ip. 26 [ + + ]: 36 : if (info == XLOG_TBLSPC_CREATE)
27 : : {
28 : 14 : xl_tblspc_create_rec *xlrec = (xl_tblspc_create_rec *) rec;
29 : :
4246 andres@anarazel.de 30 : 14 : appendStringInfo(buf, "%u \"%s\"", xlrec->ts_id, xlrec->ts_path);
31 : : }
4906 alvherre@alvh.no-ip. 32 [ + - ]: 22 : else if (info == XLOG_TBLSPC_DROP)
33 : : {
34 : 22 : xl_tblspc_drop_rec *xlrec = (xl_tblspc_drop_rec *) rec;
35 : :
4246 andres@anarazel.de 36 : 22 : appendStringInfo(buf, "%u", xlrec->ts_id);
37 : : }
38 : 36 : }
39 : :
40 : : const char *
41 : 42 : tblspc_identify(uint8 info)
42 : : {
43 : 42 : const char *id = NULL;
44 : :
4243 45 [ + + - ]: 42 : switch (info & ~XLR_INFO_MASK)
46 : : {
4246 47 : 17 : case XLOG_TBLSPC_CREATE:
48 : 17 : id = "CREATE";
49 : 17 : break;
50 : 25 : case XLOG_TBLSPC_DROP:
51 : 25 : id = "DROP";
52 : 25 : break;
53 : : }
54 : :
55 : 42 : return id;
56 : : }
|