1 /*-------------------------------------------------------------------------
4 * Tablespace management commands (create/drop tablespace).
7 * Portions Copyright (c) 1996-2015, 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"
23 #define XLOG_TBLSPC_CREATE 0x00
24 #define XLOG_TBLSPC_DROP 0x10
26 typedef struct xl_tblspc_create_rec
29 char ts_path[FLEXIBLE_ARRAY_MEMBER]; /* null-terminated string */
30 } xl_tblspc_create_rec;
32 typedef struct xl_tblspc_drop_rec
37 typedef struct TableSpaceOpts
39 int32 vl_len_; /* varlena header (do not touch directly!) */
40 float8 random_page_cost;
42 int effective_io_concurrency;
45 extern Oid CreateTableSpace(CreateTableSpaceStmt *stmt);
46 extern void DropTableSpace(DropTableSpaceStmt *stmt);
47 extern ObjectAddress RenameTableSpace(const char *oldname, const char *newname);
48 extern Oid AlterTableSpaceOptions(AlterTableSpaceOptionsStmt *stmt);
50 extern void TablespaceCreateDbspace(Oid spcNode, Oid dbNode, bool isRedo);
52 extern Oid GetDefaultTablespace(char relpersistence);
54 extern void PrepareTempTablespaces(void);
56 extern Oid get_tablespace_oid(const char *tablespacename, bool missing_ok);
57 extern char *get_tablespace_name(Oid spc_oid);
59 extern bool directory_is_empty(const char *path);
60 extern void remove_tablespace_symlink(const char *linkloc);
62 extern void tblspc_redo(XLogReaderState *rptr);
63 extern void tblspc_desc(StringInfo buf, XLogReaderState *rptr);
64 extern const char *tblspc_identify(uint8 info);
66 #endif /* TABLESPACE_H */