1 /*-------------------------------------------------------------------------
4 * Tablespace management commands (create/drop tablespace).
7 * Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
10 * src/include/commands/tablespace.h
12 *-------------------------------------------------------------------------
17 #include "access/xlogreader.h"
18 #include "catalog/objectaddress.h"
19 #include "lib/stringinfo.h"
20 #include "nodes/parsenodes.h"
22 extern bool allow_in_place_tablespaces
;
25 #define XLOG_TBLSPC_CREATE 0x00
26 #define XLOG_TBLSPC_DROP 0x10
28 typedef struct xl_tblspc_create_rec
31 char ts_path
[FLEXIBLE_ARRAY_MEMBER
]; /* null-terminated string */
32 } xl_tblspc_create_rec
;
34 typedef struct xl_tblspc_drop_rec
39 typedef struct TableSpaceOpts
41 int32 vl_len_
; /* varlena header (do not touch directly!) */
42 float8 random_page_cost
;
44 int effective_io_concurrency
;
47 extern Oid
CreateTableSpace(CreateTableSpaceStmt
*stmt
);
48 extern void DropTableSpace(DropTableSpaceStmt
*stmt
);
49 extern ObjectAddress
RenameTableSpace(const char *oldname
, const char *newname
);
50 extern Oid
AlterTableSpaceOptions(AlterTableSpaceOptionsStmt
*stmt
);
52 extern void TablespaceCreateDbspace(Oid spcNode
, Oid dbNode
, bool isRedo
);
54 extern Oid
GetDefaultTablespace(char relpersistence
, bool partitioned
);
56 extern void PrepareTempTablespaces(void);
58 extern Oid
get_tablespace_oid(const char *tablespacename
, bool missing_ok
);
59 extern char *get_tablespace_name(Oid spc_oid
);
61 extern bool directory_is_empty(const char *path
);
62 extern void remove_tablespace_symlink(const char *linkloc
);
64 extern void tblspc_redo(XLogReaderState
*rptr
);
65 extern void tblspc_desc(StringInfo buf
, XLogReaderState
*rptr
);
66 extern const char *tblspc_identify(uint8 info
);
68 #endif /* TABLESPACE_H */