>From 6d0abd7bcaca596ac2298d8f7ac408e465ec1aef Mon Sep 17 00:00:00 2001
From: Craig Ringer <craig@2ndquadrant.com>
Date: Wed, 12 Feb 2014 11:48:23 +0800
Subject: [PATCH] Warn about risks of tablespace misuse

---
 doc/src/sgml/manage-ag.sgml             | 17 +++++++++++++++++
 doc/src/sgml/ref/create_tablespace.sgml | 10 ++++++++++
 2 files changed, 27 insertions(+)

diff --git a/doc/src/sgml/manage-ag.sgml b/doc/src/sgml/manage-ag.sgml
index b44d521..dd43e19 100644
--- a/doc/src/sgml/manage-ag.sgml
+++ b/doc/src/sgml/manage-ag.sgml
@@ -379,6 +379,23 @@ dropdb <replaceable class="parameter">dbname</replaceable>
    expensive, slower disk system.
   </para>
 
+  <warning>
+   <para>
+    Tablespaces are <emphasis>not</emphasis> suitable for backup/redundancy.
+    If the main database cluster is lost, tablespaces cannot simply be reattached
+    to a different database cluster, the metadata from the original is required
+    to read the tablespace. Similarly, if you lose a tablespace (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">
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

