aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2006-06-16 22:01:17 +0000
committerBruce Momjian <bruce@momjian.us>2006-06-16 22:01:17 +0000
commit4fff9d729008d8fd9274b160b36bef65795e0989 (patch)
treee304e7ac0573eca39dc92a47760949ee7d0ef961
parentb055f00ebb1358245657679ae621cfe9a337dcd7 (diff)
downloadpostgresql-4fff9d729008d8fd9274b160b36bef65795e0989.tar.gz
postgresql-4fff9d729008d8fd9274b160b36bef65795e0989.zip
Document issues with non-default tablespaces and pg_dumpall restores.
Backpatch documentation addition to 8.1.X.
-rw-r--r--doc/src/sgml/ref/pg_dumpall.sgml9
-rw-r--r--src/bin/pg_dump/pg_dumpall.c12
2 files changed, 18 insertions, 3 deletions
diff --git a/doc/src/sgml/ref/pg_dumpall.sgml b/doc/src/sgml/ref/pg_dumpall.sgml
index 6cf1c0d538c..e6de1ea64e5 100644
--- a/doc/src/sgml/ref/pg_dumpall.sgml
+++ b/doc/src/sgml/ref/pg_dumpall.sgml
@@ -1,5 +1,5 @@
<!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/pg_dumpall.sgml,v 1.55 2005/11/01 21:09:50 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/pg_dumpall.sgml,v 1.56 2006/06/16 22:01:17 momjian Exp $
PostgreSQL documentation
-->
@@ -377,6 +377,13 @@ PostgreSQL documentation
databases.
</para>
+ <para>
+ <application>pg_dumpall</application> requires all needed
+ tablespace directories to exist before the restore or
+ database creation will fail for databases in non-default
+ locations.
+ </para>
+
</refsect1>
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c
index ecbd15f28c4..b49766507e2 100644
--- a/src/bin/pg_dump/pg_dumpall.c
+++ b/src/bin/pg_dump/pg_dumpall.c
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
*
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.79 2006/06/07 22:24:45 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.80 2006/06/16 22:01:17 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -888,7 +888,15 @@ dumpCreateDB(PGconn *conn)
appendPQExpBuffer(buf, " ENCODING = ");
appendStringLiteralConn(buf, dbencoding, conn);
- /* Output tablespace if it isn't default */
+ /*
+ * Output tablespace if it isn't the default. For default, it
+ * uses the default from the template database. If tablespace
+ * is specified and tablespace creation failed earlier,
+ * (e.g. no such directory), the database creation will fail
+ * too. One solution would be to use 'SET default_tablespace'
+ * like we do in pg_dump for setting non-default database
+ * locations.
+ */
if (strcmp(dbtablespace, "pg_default") != 0)
appendPQExpBuffer(buf, " TABLESPACE = %s",
fmtId(dbtablespace));