Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4353d18

Browse files
committed
docs: tablespaces cannot be accessed independently
Mention impossibility of moving tablespaces, backing them upindependently, or the inadvisability of placing them on temporaryfile systems.Patch by Craig Ringer, adjustments by Ian Lawrence Warwick and me
1 parent13ecb82 commit4353d18

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

‎doc/src/sgml/manage-ag.sgml

Lines changed: 19 additions & 2 deletions
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

Lines changed: 8 additions & 0 deletions
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)

[8]ページ先頭

©2009-2025 Movatter.jp