mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-17 02:53:51 +08:00
Tablespaces can now be detached from hypertables using `tablespace_detach()`. This function can either detach a tablespace from all tables or only a specific table. Having the ability to detach tablespace allows more advanced storage management, for instance, one can detach tablespaces that are running low on diskspace while attaching new ones to replace the old ones.
26 lines
632 B
C
26 lines
632 B
C
#ifndef TIMESCALEDB_TABLESPACE_H
|
|
#define TIMESCALEDB_TABLESPACE_H
|
|
|
|
#include <postgres.h>
|
|
#include "catalog.h"
|
|
|
|
typedef struct Tablespace
|
|
{
|
|
FormData_tablespace fd;
|
|
Oid tablespace_oid;
|
|
} Tablespace;
|
|
|
|
typedef struct Tablespaces
|
|
{
|
|
int capacity;
|
|
int num_tablespaces;
|
|
Tablespace *tablespaces;
|
|
} Tablespaces;
|
|
|
|
extern Tablespace *tablespaces_add(Tablespaces *tablespaces, FormData_tablespace *form, Oid tspc_oid);
|
|
extern bool tablespaces_delete(Tablespaces *tspcs, Oid tspc_oid);
|
|
extern int tablespaces_clear(Tablespaces *tspcs);
|
|
extern Tablespaces *tablespace_scan(int32 hypertable_id);
|
|
|
|
#endif /* TIMESCALEDB_TABLESPACE_H */
|