postgresql_16:7.1.85.1 Description
PostgreSQL 16 > Reference > SQL Commands > CREATE TABLESPACE > Description
CREATE TABLESPACE registers a new cluster-wide tablespace. The tablespace name must be distinct from the name of any existing tablespace in the database cluster.
A tablespace allows superusers to define an alternative location on the file system where the data files containing database objects (such as tables and indexes) can reside.
A user with appropriate privileges can pass *tablespace_name* to CREATE DATABASE, CREATE TABLE, CREATE INDEX or ADD CONSTRAINT to have the data files for these objects stored within the specified tablespace.
Warning
A tablespace cannot be used independently of the cluster in which it is defined; see (see postgresql_16:4.8.6).