From 148ea5cbeae1681ef06e7f3ccb554b8db728b45e Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Thu, 25 Jan 2007 04:35:11 +0000 Subject: Add GUC temp_tablespaces to provide a default location for temporary objects. Jaime Casanova --- src/backend/commands/indexcmds.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/backend/commands/indexcmds.c') 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 */ } -- cgit v1.2.3