PostgreSQL Source Code  git master
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-2022, 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 
23 
24 /* XLOG stuff */
25 #define XLOG_TBLSPC_CREATE 0x00
26 #define XLOG_TBLSPC_DROP 0x10
27 
28 typedef struct xl_tblspc_create_rec
29 {
31  char ts_path[FLEXIBLE_ARRAY_MEMBER]; /* null-terminated string */
33 
34 typedef struct xl_tblspc_drop_rec
35 {
38 
39 typedef struct TableSpaceOpts
40 {
41  int32 vl_len_; /* varlena header (do not touch directly!) */
47 
49 extern void DropTableSpace(DropTableSpaceStmt *stmt);
50 extern ObjectAddress RenameTableSpace(const char *oldname, const char *newname);
52 
53 extern void TablespaceCreateDbspace(Oid spcOid, Oid dbOid, bool isRedo);
54 
55 extern Oid GetDefaultTablespace(char relpersistence, bool partitioned);
56 
57 extern void PrepareTempTablespaces(void);
58 
59 extern Oid get_tablespace_oid(const char *tablespacename, bool missing_ok);
60 extern char *get_tablespace_name(Oid spc_oid);
61 
62 extern bool directory_is_empty(const char *path);
63 extern void remove_tablespace_symlink(const char *linkloc);
64 
65 extern void tblspc_redo(XLogReaderState *record);
66 extern void tblspc_desc(StringInfo buf, XLogReaderState *record);
67 extern const char *tblspc_identify(uint8 info);
68 
69 #endif /* TABLESPACE_H */
#define PGDLLIMPORT
Definition: c.h:1252
signed int int32
Definition: c.h:430
double float8
Definition: c.h:566
#define FLEXIBLE_ARRAY_MEMBER
Definition: c.h:362
unsigned char uint8
Definition: c.h:440
static char * buf
Definition: pg_test_fsync.c:67
unsigned int Oid
Definition: postgres_ext.h:31
int maintenance_io_concurrency
Definition: tablespace.h:45
float8 random_page_cost
Definition: tablespace.h:42
int effective_io_concurrency
Definition: tablespace.h:44
float8 seq_page_cost
Definition: tablespace.h:43
char ts_path[FLEXIBLE_ARRAY_MEMBER]
Definition: tablespace.h:31
char * get_tablespace_name(Oid spc_oid)
Definition: tablespace.c:1478
Oid AlterTableSpaceOptions(AlterTableSpaceOptionsStmt *stmt)
Definition: tablespace.c:1021
struct TableSpaceOpts TableSpaceOpts
bool directory_is_empty(const char *path)
Definition: tablespace.c:859
PGDLLIMPORT bool allow_in_place_tablespaces
Definition: tablespace.c:91
struct xl_tblspc_drop_rec xl_tblspc_drop_rec
void tblspc_desc(StringInfo buf, XLogReaderState *record)
Definition: tblspcdesc.c:21
void remove_tablespace_symlink(const char *linkloc)
Definition: tablespace.c:889
void DropTableSpace(DropTableSpaceStmt *stmt)
Definition: tablespace.c:401
void PrepareTempTablespaces(void)
Definition: tablespace.c:1337
Oid get_tablespace_oid(const char *tablespacename, bool missing_ok)
Definition: tablespace.c:1432
ObjectAddress RenameTableSpace(const char *oldname, const char *newname)
Definition: tablespace.c:936
Oid GetDefaultTablespace(char relpersistence, bool partitioned)
Definition: tablespace.c:1149
void TablespaceCreateDbspace(Oid spcOid, Oid dbOid, bool isRedo)
Definition: tablespace.c:118
const char * tblspc_identify(uint8 info)
Definition: tblspcdesc.c:41
Oid CreateTableSpace(CreateTableSpaceStmt *stmt)
Definition: tablespace.c:214
struct xl_tblspc_create_rec xl_tblspc_create_rec
void tblspc_redo(XLogReaderState *record)
Definition: tablespace.c:1517