Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4353d18

Browse files
committed
docs: tablespaces cannot be accessed independently
Mention impossibility of moving tablespaces, backing them up independently, or the inadvisability of placing them on temporary file systems. Patch by Craig Ringer, adjustments by Ian Lawrence Warwick and me
1 parent 13ecb82 commit 4353d18

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

doc/src/sgml/manage-ag.sgml

+19-2
Original file line numberDiff line numberDiff line change
@@ -379,17 +379,34 @@ dropdb <replaceable class="parameter">dbname</replaceable>
379379
expensive, slower disk system.
380380
</para>
381381

382+
<warning>
383+
<para>
384+
Even though located outside the main PostgreSQL data directory,
385+
tablespaces are an integral part of the database cluster and
386+
<emphasis>cannot</emphasis> be treated as an autonomous collection
387+
of data files. They are dependent on metadata contained in the main
388+
data directory, and therefore cannot be attached to a different
389+
database cluster or backed up individually. Similarly, if you lose
390+
a tablespace (file deletion, disk failure, etc), the database cluster
391+
might become unreadable or unable to start. Placing a tablespace
392+
on a temporary file system like a ramdisk risks the reliability of
393+
the entire cluster.
394+
</para>
395+
</warning>
396+
382397
<para>
383398
To define a tablespace, use the <xref
384399
linkend="sql-createtablespace">
385400
command, for example:<indexterm><primary>CREATE TABLESPACE</></>:
386401
<programlisting>
387-
CREATE TABLESPACE fastspace LOCATION '/mnt/sda1/postgresql/data';
402+
CREATE TABLESPACE fastspace LOCATION '/ssd1/postgresql/data';
388403
</programlisting>
389404
The location must be an existing, empty directory that is owned by
390405
the <productname>PostgreSQL</> operating system user. All objects subsequently
391406
created within the tablespace will be stored in files underneath this
392-
directory.
407+
directory. The location must not be on removable or transient storage,
408+
as the cluster might fail to function if the tablespace is missing
409+
or lost.
393410
</para>
394411

395412
<note>

doc/src/sgml/ref/create_tablespace.sgml

+8
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ CREATE TABLESPACE <replaceable class="parameter">tablespace_name</replaceable>
5050
<command>CREATE INDEX</> or <command>ADD CONSTRAINT</> to have the data
5151
files for these objects stored within the specified tablespace.
5252
</para>
53+
54+
<warning>
55+
<para>
56+
A tablespace cannot be used independently of the cluster in which it
57+
is defined; see <xref linkend="manage-ag-tablespaces"/>.
58+
</para>
59+
</warning>
60+
5361
</refsect1>
5462

5563
<refsect1>

0 commit comments

Comments
 (0)