aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/ruleutils.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-06-18 06:14:31 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-06-18 06:14:31 +0000
commit2467394ee1566e82d0314d12a0d1c0a5670a28c9 (patch)
tree57b87b8c181a9c3eb0f33bf775a5f31b9de8b890 /src/backend/utils/adt/ruleutils.c
parent474875f4438ea0d18f9f4170117bc407e6812515 (diff)
downloadpostgresql-2467394ee1566e82d0314d12a0d1c0a5670a28c9.tar.gz
postgresql-2467394ee1566e82d0314d12a0d1c0a5670a28c9.zip
Tablespaces. Alternate database locations are dead, long live tablespaces.
There are various things left to do: contrib dbsize and oid2name modules need work, and so does the documentation. Also someone should think about COMMENT ON TABLESPACE and maybe RENAME TABLESPACE. Also initlocation is dead, it just doesn't know it yet. Gavin Sherry and Tom Lane.
Diffstat (limited to 'src/backend/utils/adt/ruleutils.c')
-rw-r--r--src/backend/utils/adt/ruleutils.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c
index 4caaabd62cd..1a2fe54d7ac 100644
--- a/src/backend/utils/adt/ruleutils.c
+++ b/src/backend/utils/adt/ruleutils.c
@@ -3,7 +3,7 @@
* back to source text
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.172 2004/06/16 01:26:47 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.173 2004/06/18 06:13:49 tgl Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
@@ -53,6 +53,7 @@
#include "catalog/pg_operator.h"
#include "catalog/pg_shadow.h"
#include "catalog/pg_trigger.h"
+#include "commands/tablespace.h"
#include "executor/spi.h"
#include "lib/stringinfo.h"
#include "nodes/makefuncs.h"
@@ -768,6 +769,23 @@ pg_get_indexdef_worker(Oid indexrelid, int colno, int prettyFlags)
appendStringInfoChar(&buf, ')');
/*
+ * If the index is in a different tablespace from its parent,
+ * tell about that
+ */
+ if (OidIsValid(idxrelrec->reltablespace) &&
+ idxrelrec->reltablespace != get_rel_tablespace(indrelid))
+ {
+ char *spcname = get_tablespace_name(idxrelrec->reltablespace);
+
+ if (spcname) /* just paranoia... */
+ {
+ appendStringInfo(&buf, " TABLESPACE %s",
+ quote_identifier(spcname));
+ pfree(spcname);
+ }
+ }
+
+ /*
* If it's a partial index, decompile and append the predicate
*/
if (!heap_attisnull(ht_idx, Anum_pg_index_indpred))