diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 12:15:05 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 12:15:05 +0000 |
commit | 46651ce6fe013220ed397add242004d764fc0153 (patch) | |
tree | 6e5299f990f88e60174a1d3ae6e48eedd2688b2b /src/include/commands/tablespace.h | |
parent | Initial commit. (diff) | |
download | postgresql-14-46651ce6fe013220ed397add242004d764fc0153.tar.xz postgresql-14-46651ce6fe013220ed397add242004d764fc0153.zip |
Adding upstream version 14.5.upstream/14.5upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/include/commands/tablespace.h')
-rw-r--r-- | src/include/commands/tablespace.h | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/src/include/commands/tablespace.h b/src/include/commands/tablespace.h new file mode 100644 index 0000000..f33ba51 --- /dev/null +++ b/src/include/commands/tablespace.h @@ -0,0 +1,69 @@ +/*------------------------------------------------------------------------- + * + * tablespace.h + * Tablespace management commands (create/drop tablespace). + * + * + * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * src/include/commands/tablespace.h + * + *------------------------------------------------------------------------- + */ +#ifndef TABLESPACE_H +#define TABLESPACE_H + +#include "access/xlogreader.h" +#include "catalog/objectaddress.h" +#include "lib/stringinfo.h" +#include "nodes/parsenodes.h" + +extern bool allow_in_place_tablespaces; + +/* XLOG stuff */ +#define XLOG_TBLSPC_CREATE 0x00 +#define XLOG_TBLSPC_DROP 0x10 + +typedef struct xl_tblspc_create_rec +{ + Oid ts_id; + char ts_path[FLEXIBLE_ARRAY_MEMBER]; /* null-terminated string */ +} xl_tblspc_create_rec; + +typedef struct xl_tblspc_drop_rec +{ + Oid ts_id; +} xl_tblspc_drop_rec; + +typedef struct TableSpaceOpts +{ + int32 vl_len_; /* varlena header (do not touch directly!) */ + float8 random_page_cost; + float8 seq_page_cost; + int effective_io_concurrency; + int maintenance_io_concurrency; +} TableSpaceOpts; + +extern Oid CreateTableSpace(CreateTableSpaceStmt *stmt); +extern void DropTableSpace(DropTableSpaceStmt *stmt); +extern ObjectAddress RenameTableSpace(const char *oldname, const char *newname); +extern Oid AlterTableSpaceOptions(AlterTableSpaceOptionsStmt *stmt); + +extern void TablespaceCreateDbspace(Oid spcNode, Oid dbNode, bool isRedo); + +extern Oid GetDefaultTablespace(char relpersistence, bool partitioned); + +extern void PrepareTempTablespaces(void); + +extern Oid get_tablespace_oid(const char *tablespacename, bool missing_ok); +extern char *get_tablespace_name(Oid spc_oid); + +extern bool directory_is_empty(const char *path); +extern void remove_tablespace_symlink(const char *linkloc); + +extern void tblspc_redo(XLogReaderState *rptr); +extern void tblspc_desc(StringInfo buf, XLogReaderState *rptr); +extern const char *tblspc_identify(uint8 info); + +#endif /* TABLESPACE_H */ |