7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.69 1999/09/04 18:42:13 tgl Exp $
10
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.70 1999/09/04 21:47:23 tgl Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
56
56
#include "utils/builtins.h"
57
57
#include "utils/catcache.h"
58
58
#include "utils/relcache.h"
59
+ #include "utils/temprel.h"
59
60
60
61
61
62
static void RelationFlushRelation (Relation * relationPtr ,
@@ -1182,6 +1183,7 @@ RelationIdGetRelation(Oid relationId)
1182
1183
Relation
1183
1184
RelationNameGetRelation (char * relationName )
1184
1185
{
1186
+ char * temprelname ;
1185
1187
Relation rd ;
1186
1188
RelationBuildDescInfo buildinfo ;
1187
1189
@@ -1192,6 +1194,15 @@ RelationNameGetRelation(char *relationName)
1192
1194
IncrHeapAccessStat (local_RelationNameGetRelation );
1193
1195
IncrHeapAccessStat (global_RelationNameGetRelation );
1194
1196
1197
+ /* ----------------
1198
+ * if caller is looking for a temp relation, substitute its real name;
1199
+ * we only index temp rels by their real names.
1200
+ * ----------------
1201
+ */
1202
+ temprelname = get_temp_rel_by_name (relationName );
1203
+ if (temprelname )
1204
+ relationName = temprelname ;
1205
+
1195
1206
/* ----------------
1196
1207
* first try and get a reldesc from the cache
1197
1208
* ----------------
@@ -1212,26 +1223,6 @@ RelationNameGetRelation(char *relationName)
1212
1223
return rd ;
1213
1224
}
1214
1225
1215
- /* ----------------
1216
- * old "getreldesc" interface.
1217
- * ----------------
1218
- */
1219
- #ifdef NOT_USED
1220
- Relation
1221
- getreldesc (char * relationName )
1222
- {
1223
- /* ----------------
1224
- * increment access statistics
1225
- * ----------------
1226
- */
1227
- IncrHeapAccessStat (local_getreldesc );
1228
- IncrHeapAccessStat (global_getreldesc );
1229
-
1230
- return RelationNameGetRelation (relationName );
1231
- }
1232
-
1233
- #endif
1234
-
1235
1226
/* ----------------------------------------------------------------
1236
1227
* cache invalidation support routines
1237
1228
* ----------------------------------------------------------------
0 commit comments