CREATE TABLESPACE
Defines a new tablespace.
Synopsis
CREATE TABLESPACE <tablespace_name>
[ OWNER { <owner_name> | CURRENT_USER | SESSION_USER } ]
LOCATION '<directory>'
[ WITH (content<ID_1>='<directory>'[, content<ID_2>='<directory>' ... ] [, <tablespace_option = value [, ... ] ] ) ]
Description
CREATE TABLESPACE
registers and configures a new tablespace for your Apache Cloudberry system. The tablespace name must be distinct from the name of any existing tablespace in the system. A tablespace is a Apache Cloudberry system object (a global object), you can use a tablespace from any database if you have appropriate privileges.
A tablespace allows superusers to define an alternative host file system location where the data files containing database objects (such as tables and indexes) reside.
A user with appropriate privileges can pass tablespace_name to CREATE DATABASE
, CREATE TABLE
, or CREATE INDEX
to direct Apache Cloudberry to store the data files for these objects within the specified tablespace.
In Apache Cloudberry, the file system location must exist on all hosts including the hosts running the coordinator, standby mirror, each primary segment, and each mirror segment.