|
3 | 3 | *back to source text |
4 | 4 | * |
5 | 5 | * IDENTIFICATION |
6 | | - * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.182 2004/10/07 20:36:52 tgl Exp $ |
| 6 | + * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.183 2004/10/17 21:17:27 tgl Exp $ |
7 | 7 | * |
8 | 8 | * This software is copyrighted by Jan Wieck - Hamburg. |
9 | 9 | * |
|
58 | 58 | #include"commands/tablespace.h" |
59 | 59 | #include"executor/spi.h" |
60 | 60 | #include"lib/stringinfo.h" |
| 61 | +#include"miscadmin.h" |
61 | 62 | #include"nodes/makefuncs.h" |
62 | 63 | #include"optimizer/clauses.h" |
63 | 64 | #include"optimizer/tlist.h" |
@@ -777,10 +778,14 @@ pg_get_indexdef_worker(Oid indexrelid, int colno, int prettyFlags) |
777 | 778 | * If the index is in a different tablespace from its parent, tell |
778 | 779 | * about that |
779 | 780 | */ |
780 | | -if (OidIsValid(idxrelrec->reltablespace)&& |
781 | | -idxrelrec->reltablespace!=get_rel_tablespace(indrelid)) |
| 781 | +if (idxrelrec->reltablespace!=get_rel_tablespace(indrelid)) |
782 | 782 | { |
783 | | -char*spcname=get_tablespace_name(idxrelrec->reltablespace); |
| 783 | +char*spcname; |
| 784 | + |
| 785 | +if (OidIsValid(idxrelrec->reltablespace)) |
| 786 | +spcname=get_tablespace_name(idxrelrec->reltablespace); |
| 787 | +else |
| 788 | +spcname=get_tablespace_name(MyDatabaseTableSpace); |
784 | 789 |
|
785 | 790 | if (spcname)/* just paranoia... */ |
786 | 791 | { |
|