PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
tablespace.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * tablespace.h
4  * Tablespace management commands (create/drop tablespace).
5  *
6  *
7  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/commands/tablespace.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef TABLESPACE_H
15 #define TABLESPACE_H
16 
17 #include "access/xlogreader.h"
18 #include "catalog/objectaddress.h"
19 #include "lib/stringinfo.h"
20 #include "nodes/parsenodes.h"
21 
22 /* XLOG stuff */
23 #define XLOG_TBLSPC_CREATE 0x00
24 #define XLOG_TBLSPC_DROP 0x10
25 
26 typedef struct xl_tblspc_create_rec
27 {
29  char ts_path[FLEXIBLE_ARRAY_MEMBER]; /* null-terminated string */
31 
32 typedef struct xl_tblspc_drop_rec
33 {
36 
37 typedef struct TableSpaceOpts
38 {
39  int32 vl_len_; /* varlena header (do not touch directly!) */
44 
46 extern void DropTableSpace(DropTableSpaceStmt *stmt);
47 extern ObjectAddress RenameTableSpace(const char *oldname, const char *newname);
49 
50 extern void TablespaceCreateDbspace(Oid spcNode, Oid dbNode, bool isRedo);
51 
52 extern Oid GetDefaultTablespace(char relpersistence);
53 
54 extern void PrepareTempTablespaces(void);
55 
56 extern Oid get_tablespace_oid(const char *tablespacename, bool missing_ok);
57 extern char *get_tablespace_name(Oid spc_oid);
58 
59 extern bool directory_is_empty(const char *path);
60 extern void remove_tablespace_symlink(const char *linkloc);
61 
62 extern void tblspc_redo(XLogReaderState *rptr);
63 extern void tblspc_desc(StringInfo buf, XLogReaderState *rptr);
64 extern const char *tblspc_identify(uint8 info);
65 
66 #endif /* TABLESPACE_H */
Oid AlterTableSpaceOptions(AlterTableSpaceOptionsStmt *stmt)
Definition: tablespace.c:986
Oid GetDefaultTablespace(char relpersistence)
Definition: tablespace.c:1111
void tblspc_desc(StringInfo buf, XLogReaderState *rptr)
Definition: tblspcdesc.c:21
char ts_path[FLEXIBLE_ARRAY_MEMBER]
Definition: tablespace.h:29
Oid CreateTableSpace(CreateTableSpaceStmt *stmt)
Definition: tablespace.c:233
Oid get_tablespace_oid(const char *tablespacename, bool missing_ok)
Definition: tablespace.c:1380
float8 random_page_cost
Definition: tablespace.h:40
unsigned char uint8
Definition: c.h:266
char * get_tablespace_name(Oid spc_oid)
Definition: tablespace.c:1426
unsigned int Oid
Definition: postgres_ext.h:31
bool directory_is_empty(const char *path)
Definition: tablespace.c:831
signed int int32
Definition: c.h:256
float8 seq_page_cost
Definition: tablespace.h:41
double float8
Definition: c.h:381
static char * buf
Definition: pg_test_fsync.c:65
struct TableSpaceOpts TableSpaceOpts
void PrepareTempTablespaces(void)
Definition: tablespace.c:1287
void remove_tablespace_symlink(const char *linkloc)
Definition: tablespace.c:861
ObjectAddress RenameTableSpace(const char *oldname, const char *newname)
Definition: tablespace.c:910
struct xl_tblspc_create_rec xl_tblspc_create_rec
void TablespaceCreateDbspace(Oid spcNode, Oid dbNode, bool isRedo)
Definition: tablespace.c:115
void DropTableSpace(DropTableSpaceStmt *stmt)
Definition: tablespace.c:400
struct xl_tblspc_drop_rec xl_tblspc_drop_rec
void tblspc_redo(XLogReaderState *rptr)
Definition: tablespace.c:1465
int effective_io_concurrency
Definition: tablespace.h:42
const char * tblspc_identify(uint8 info)
Definition: tblspcdesc.c:41