2
0

tablespace.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. #include "access/xlogreader.h"
  17. #include "catalog/objectaddress.h"
  18. #include "lib/stringinfo.h"
  19. #include "nodes/parsenodes.h"
  20. extern PGDLLIMPORT bool allow_in_place_tablespaces;
  21. /* XLOG stuff */
  22. #define XLOG_TBLSPC_CREATE 0x00
  23. #define XLOG_TBLSPC_DROP 0x10
  24. typedef struct xl_tblspc_create_rec
  25. {
  26. Oid ts_id;
  27. char ts_path[FLEXIBLE_ARRAY_MEMBER]; /* null-terminated string */
  28. } xl_tblspc_create_rec;
  29. typedef struct xl_tblspc_drop_rec
  30. {
  31. Oid ts_id;
  32. } xl_tblspc_drop_rec;
  33. typedef struct TableSpaceOpts
  34. {
  35. int32 vl_len_; /* varlena header (do not touch directly!) */
  36. float8 random_page_cost;
  37. float8 seq_page_cost;
  38. int effective_io_concurrency;
  39. int maintenance_io_concurrency;
  40. } TableSpaceOpts;
  41. extern Oid CreateTableSpace(CreateTableSpaceStmt *stmt);
  42. extern void DropTableSpace(DropTableSpaceStmt *stmt);
  43. extern ObjectAddress RenameTableSpace(const char *oldname, const char *newname);
  44. extern Oid AlterTableSpaceOptions(AlterTableSpaceOptionsStmt *stmt);
  45. extern void TablespaceCreateDbspace(Oid spcNode, Oid dbNode, bool isRedo);
  46. extern Oid GetDefaultTablespace(char relpersistence, bool partitioned);
  47. extern void PrepareTempTablespaces(void);
  48. extern Oid get_tablespace_oid(const char *tablespacename, bool missing_ok);
  49. extern char *get_tablespace_name(Oid spc_oid);
  50. extern bool directory_is_empty(const char *path);
  51. extern void remove_tablespace_symlink(const char *linkloc);
  52. extern void tblspc_redo(XLogReaderState *rptr);
  53. extern void tblspc_desc(StringInfo buf, XLogReaderState *rptr);
  54. extern const char *tblspc_identify(uint8 info);
  55. #endif /* TABLESPACE_H */