CREATE TABLESPACE - define a new tablespace
CREATE TABLESPACE tablespacename [ OWNER username ] LOCATION 'directory'
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) may reside.
A user with appropriate privileges can pass tablespacename to CREATE DATABASE, CREATE TABLE, CREATE INDEX or ADD CONSTRAINT to have the data files for these objects stored within the specified tablespace.
Tablespaces are only supported on systems that support symbolic links.
Create a tablespace dbspace at /data/dbs:
CREATE TABLESPACE dbspace LOCATION '/data/dbs';
Create a tablespace indexspace at /data/indexes owned by user genevieve:
CREATE TABLESPACE indexspace OWNER genevieve LOCATION '/data/indexes';
CREATE TABLESPACE is a PostgreSQL extension.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |