diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-10-17 21:17:27 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-10-17 21:17:27 +0000 |
commit | bdbe9c9f061439f180976b75e4be50f5ea64d07f (patch) | |
tree | 569edd5484e17d208b5dd833727afc72f87b04e3 /src/backend/utils/adt/ruleutils.c | |
parent | ca14e3bc01bbe0bdb5148649d6865ffc458ba873 (diff) | |
download | postgresql-bdbe9c9f061439f180976b75e4be50f5ea64d07f.tar.gz postgresql-bdbe9c9f061439f180976b75e4be50f5ea64d07f.zip |
pg_get_indexdef() didn't do quite the right thing with identifying
an index's tablespace.
Diffstat (limited to 'src/backend/utils/adt/ruleutils.c')
-rw-r--r-- | src/backend/utils/adt/ruleutils.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index a05bc8489dd..3833ee2ee2f 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.182 2004/10/07 20:36:52 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.183 2004/10/17 21:17:27 tgl Exp $ * * This software is copyrighted by Jan Wieck - Hamburg. * @@ -58,6 +58,7 @@ #include "commands/tablespace.h" #include "executor/spi.h" #include "lib/stringinfo.h" +#include "miscadmin.h" #include "nodes/makefuncs.h" #include "optimizer/clauses.h" #include "optimizer/tlist.h" @@ -777,10 +778,14 @@ pg_get_indexdef_worker(Oid indexrelid, int colno, int prettyFlags) * If the index is in a different tablespace from its parent, tell * about that */ - if (OidIsValid(idxrelrec->reltablespace) && - idxrelrec->reltablespace != get_rel_tablespace(indrelid)) + if (idxrelrec->reltablespace != get_rel_tablespace(indrelid)) { - char *spcname = get_tablespace_name(idxrelrec->reltablespace); + char *spcname; + + if (OidIsValid(idxrelrec->reltablespace)) + spcname = get_tablespace_name(idxrelrec->reltablespace); + else + spcname = get_tablespace_name(MyDatabaseTableSpace); if (spcname) /* just paranoia... */ { |