PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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-2025, 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"
19#include "lib/stringinfo.h"
20#include "nodes/parsenodes.h"
21
23extern PGDLLIMPORT char *temp_tablespaces;
25
26/* XLOG stuff */
27#define XLOG_TBLSPC_CREATE 0x00
28#define XLOG_TBLSPC_DROP 0x10
29
31{
33 char ts_path[FLEXIBLE_ARRAY_MEMBER]; /* null-terminated string */
35
36typedef struct xl_tblspc_drop_rec
37{
40
41typedef struct TableSpaceOpts
42{
43 int32 vl_len_; /* varlena header (do not touch directly!) */
49
52extern ObjectAddress RenameTableSpace(const char *oldname, const char *newname);
54
55extern void TablespaceCreateDbspace(Oid spcOid, Oid dbOid, bool isRedo);
56
57extern Oid GetDefaultTablespace(char relpersistence, bool partitioned);
58
59extern void PrepareTempTablespaces(void);
60
61extern Oid get_tablespace_oid(const char *tablespacename, bool missing_ok);
62extern char *get_tablespace_name(Oid spc_oid);
63
64extern bool directory_is_empty(const char *path);
65extern void remove_tablespace_symlink(const char *linkloc);
66
67extern void tblspc_redo(XLogReaderState *record);
68extern void tblspc_desc(StringInfo buf, XLogReaderState *record);
69extern const char *tblspc_identify(uint8 info);
70
71#endif /* TABLESPACE_H */
#define PGDLLIMPORT
Definition: c.h:1291
uint8_t uint8
Definition: c.h:500
double float8
Definition: c.h:601
#define FLEXIBLE_ARRAY_MEMBER
Definition: c.h:434
int32_t int32
Definition: c.h:498
#define stmt
Definition: indent_codes.h:59
static char * buf
Definition: pg_test_fsync.c:72
unsigned int Oid
Definition: postgres_ext.h:30
int maintenance_io_concurrency
Definition: tablespace.h:47
float8 random_page_cost
Definition: tablespace.h:44
int effective_io_concurrency
Definition: tablespace.h:46
float8 seq_page_cost
Definition: tablespace.h:45
char ts_path[FLEXIBLE_ARRAY_MEMBER]
Definition: tablespace.h:33
Oid AlterTableSpaceOptions(AlterTableSpaceOptionsStmt *stmt)
Definition: tablespace.c:1015
struct TableSpaceOpts TableSpaceOpts
PGDLLIMPORT char * default_tablespace
Definition: tablespace.c:83
bool directory_is_empty(const char *path)
Definition: tablespace.c:853
PGDLLIMPORT bool allow_in_place_tablespaces
Definition: tablespace.c:85
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:883
char * get_tablespace_name(Oid spc_oid)
Definition: tablespace.c:1472
void DropTableSpace(DropTableSpaceStmt *stmt)
Definition: tablespace.c:395
void PrepareTempTablespaces(void)
Definition: tablespace.c:1331
Oid get_tablespace_oid(const char *tablespacename, bool missing_ok)
Definition: tablespace.c:1426
PGDLLIMPORT char * temp_tablespaces
Definition: tablespace.c:84
ObjectAddress RenameTableSpace(const char *oldname, const char *newname)
Definition: tablespace.c:930
Oid GetDefaultTablespace(char relpersistence, bool partitioned)
Definition: tablespace.c:1143
void TablespaceCreateDbspace(Oid spcOid, Oid dbOid, bool isRedo)
Definition: tablespace.c:112
const char * tblspc_identify(uint8 info)
Definition: tblspcdesc.c:41
Oid CreateTableSpace(CreateTableSpaceStmt *stmt)
Definition: tablespace.c:208
struct xl_tblspc_create_rec xl_tblspc_create_rec
void tblspc_redo(XLogReaderState *record)
Definition: tablespace.c:1511