PostgreSQL Source Code: src/include/commands/tablespace.h Source File

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-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"
18#include "catalog/objectaddress.h"
19#include "lib/stringinfo.h"
20#include "nodes/parsenodes.h"
21
22extern PGDLLIMPORT char *default_tablespace;
23extern PGDLLIMPORT char *temp_tablespaces;
24extern PGDLLIMPORT bool allow_in_place_tablespaces;
25
26/* XLOG stuff */
27 #define XLOG_TBLSPC_CREATE 0x00
28 #define XLOG_TBLSPC_DROP 0x10
29
30 typedef struct xl_tblspc_create_rec
31{
32 Oid ts_id;
33 char ts_path[FLEXIBLE_ARRAY_MEMBER]; /* null-terminated string */
34 } xl_tblspc_create_rec;
35
36 typedef struct xl_tblspc_drop_rec
37{
38 Oid ts_id;
39 } xl_tblspc_drop_rec;
40
41 typedef struct TableSpaceOpts
42{
43 int32 vl_len_; /* varlena header (do not touch directly!) */
44 float8 random_page_cost;
45 float8 seq_page_cost;
46 int effective_io_concurrency;
47 int maintenance_io_concurrency;
48 } TableSpaceOpts;
49
50extern Oid CreateTableSpace(CreateTableSpaceStmt *stmt);
51extern void DropTableSpace(DropTableSpaceStmt *stmt);
52extern ObjectAddress RenameTableSpace(const char *oldname, const char *newname);
53extern Oid AlterTableSpaceOptions(AlterTableSpaceOptionsStmt *stmt);
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:1319
uint8_t uint8
Definition: c.h:536
double float8
Definition: c.h:635
#define FLEXIBLE_ARRAY_MEMBER
Definition: c.h:470
int32_t int32
Definition: c.h:534
#define stmt
Definition: indent_codes.h:59
static char * buf
Definition: pg_test_fsync.c:72
unsigned int Oid
Definition: postgres_ext.h:32
int maintenance_io_concurrency
Definition: tablespace.h:47
float8 random_page_cost
Definition: tablespace.h:44
int32 vl_len_
Definition: tablespace.h:43
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

AltStyle によって変換されたページ (->オリジナル) /