public inbox for [email protected]
help / color / mirror / Atom feedFrom: Craig Ringer <[email protected]>
To: Ian Lawrence Barwick <[email protected]>
To: PostgreSQL Developers <[email protected]>
Subject: Re: PATCH: Warn users about tablespace abuse data loss risk
Date: Thu, 13 Feb 2014 08:15:59 +0800
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAB8KJ=h5hy+1Dt-v2jK=uLtEc5iPeR1ksSXO-sOwcVAZvXVyvQ@mail.gmail.com>
References: <[email protected]>
<CAB8KJ=hR+tmQAxdV8Gv3tJUN3cUp5o_x4t-mj5Ub=ZhZbYBcig@mail.gmail.com>
<[email protected]>
<CAB8KJ=iFi6V5xRojdWeSC+CWNksRsAB9MNkjB9Th37aQg38w8Q@mail.gmail.com>
<CAB8KJ=h5hy+1Dt-v2jK=uLtEc5iPeR1ksSXO-sOwcVAZvXVyvQ@mail.gmail.com>
List-Unsubscribe: <mailto:[email protected]?body=unsub%20pgsql-docs>
On 02/12/2014 02:35 PM, Ian Lawrence Barwick wrote:
> And taking a look at the page in question I see this prominent example:
>
> CREATE TABLESPACE fastspace LOCATION '/mnt/sda1/postgresql/data';
Here's an updated patch, adopting your wording for the first par and
tweaking the example.
--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
--
Sent via pgsql-docs mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs
Attachments:
[text/x-patch] 0001-Warn-about-risks-of-tablespace-misuse.patch (3.3K, 2-0001-Warn-about-risks-of-tablespace-misuse.patch)
download | inline diff:
From a754f61f5228e0d066edc10ae903282b36f9a256 Mon Sep 17 00:00:00 2001
From: Craig Ringer <[email protected]>
Date: Wed, 12 Feb 2014 11:48:23 +0800
Subject: [PATCH] Warn about risks of tablespace misuse
With rewording by Ian Barwick
---
doc/src/sgml/manage-ag.sgml | 28 +++++++++++++++++++++++++++-
doc/src/sgml/ref/create_tablespace.sgml | 10 ++++++++++
2 files changed, 37 insertions(+), 1 deletion(-)
diff --git a/doc/src/sgml/manage-ag.sgml b/doc/src/sgml/manage-ag.sgml
index b44d521..efd080f 100644
--- a/doc/src/sgml/manage-ag.sgml
+++ b/doc/src/sgml/manage-ag.sgml
@@ -379,12 +379,33 @@ dropdb <replaceable class="parameter">dbname</replaceable>
expensive, slower disk system.
</para>
+ <warning>
+ <para>
+ Even if they are located outside the main PostgreSQL data directory,
+ tablespaces are an integral part of the database cluster and
+ <emphasis>cannot</emphasis> be treated as an autonomous collection of data
+ files. They rely on metadata contained in the main data directory, without
+ which they are useless. In particular, tablespaces cannot be reattached to
+ a different database cluster, and backing up individual tablespaces makes
+ no sense as a backup/redundancy method. Similarly, if you lose a
+ tablespace (file deletion, disk failure, etc) the main database may become
+ unreadable or fail to start.
+ </para>
+
+ <para>
+ Do not attempt to use tablespaces to transfer tables between database
+ clusters, for backup and restore, or to partition your data based on
+ the reliability of the storage it is on. <emphasis>Never put a tablespace
+ on a ramdisk or temporary file system</emphasis>.
+ </para>
+ </warning>
+
<para>
To define a tablespace, use the <xref
linkend="sql-createtablespace">
command, for example:<indexterm><primary>CREATE TABLESPACE</></>:
<programlisting>
-CREATE TABLESPACE fastspace LOCATION '/mnt/sda1/postgresql/data';
+CREATE TABLESPACE fastspace LOCATION '/ssd1/postgresql/data';
</programlisting>
The location must be an existing, empty directory that is owned by
the <productname>PostgreSQL</> operating system user. All objects subsequently
@@ -392,6 +413,11 @@ CREATE TABLESPACE fastspace LOCATION '/mnt/sda1/postgresql/data';
directory.
</para>
+ <para>
+ The location must not be on removable or transient storage, as the database
+ will not work if the tablespace is missing or lost.
+ </para>
+
<note>
<para>
There is usually not much point in making more than one
diff --git a/doc/src/sgml/ref/create_tablespace.sgml b/doc/src/sgml/ref/create_tablespace.sgml
index 04c5fb8..83edd88 100644
--- a/doc/src/sgml/ref/create_tablespace.sgml
+++ b/doc/src/sgml/ref/create_tablespace.sgml
@@ -50,6 +50,16 @@ CREATE TABLESPACE <replaceable class="parameter">tablespace_name</replaceable>
<command>CREATE INDEX</> or <command>ADD CONSTRAINT</> to have the data
files for these objects stored within the specified tablespace.
</para>
+
+ <warning>
+ <para>
+ You can't use the contents of a tablespace without the database it's part of,
+ nor can you use the main database if a tablespace is missing. Don't try to
+ use tablespaces for backup or redundancy.
+ See <xref linkend="manage-ag-tablespaces" />.
+ </para>
+ </warning>
+
</refsect1>
<refsect1>
--
1.8.3.1
view thread (7+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: PATCH: Warn users about tablespace abuse data loss risk
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox