diff options
author | Bruce Momjian <bruce@momjian.us> | 2007-01-25 04:35:11 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2007-01-25 04:35:11 +0000 |
commit | 148ea5cbeae1681ef06e7f3ccb554b8db728b45e (patch) | |
tree | b6325d169510eb7a38f0558ef5dc301dac988c53 /src/backend/commands/indexcmds.c | |
parent | 5af6b2abe90d52f7a4dee998c3a5eb24794bf0b1 (diff) | |
download | postgresql-148ea5cbeae1681ef06e7f3ccb554b8db728b45e.tar.gz postgresql-148ea5cbeae1681ef06e7f3ccb554b8db728b45e.zip |
Add GUC temp_tablespaces to provide a default location for temporary
objects.
Jaime Casanova
Diffstat (limited to 'src/backend/commands/indexcmds.c')
-rw-r--r-- | src/backend/commands/indexcmds.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index 2d51dfb11fe..a7183127110 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/indexcmds.c,v 1.153 2007/01/20 23:13:01 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/indexcmds.c,v 1.154 2007/01/25 04:35:10 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -209,7 +209,13 @@ DefineIndex(RangeVar *heapRelation, } else { - tablespaceId = GetDefaultTablespace(); + /* + * if the target table is temporary then use a temp_tablespace + */ + if (!rel->rd_istemp) + tablespaceId = GetDefaultTablespace(); + else + tablespaceId = GetTempTablespace(); /* note InvalidOid is OK in this case */ } |