*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.69 1999/09/04 18:42:13 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.70 1999/09/04 21:47:23 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "utils/builtins.h"
#include "utils/catcache.h"
#include "utils/relcache.h"
+#include "utils/temprel.h"
static void RelationFlushRelation(Relation *relationPtr,
Relation
RelationNameGetRelation(char *relationName)
{
+ char *temprelname;
Relation rd;
RelationBuildDescInfo buildinfo;
IncrHeapAccessStat(local_RelationNameGetRelation);
IncrHeapAccessStat(global_RelationNameGetRelation);
+ /* ----------------
+ * if caller is looking for a temp relation, substitute its real name;
+ * we only index temp rels by their real names.
+ * ----------------
+ */
+ temprelname = get_temp_rel_by_name(relationName);
+ if (temprelname)
+ relationName = temprelname;
+
/* ----------------
* first try and get a reldesc from the cache
* ----------------
return rd;
}
-/* ----------------
- * old "getreldesc" interface.
- * ----------------
- */
-#ifdef NOT_USED
-Relation
-getreldesc(char *relationName)
-{
- /* ----------------
- * increment access statistics
- * ----------------
- */
- IncrHeapAccessStat(local_getreldesc);
- IncrHeapAccessStat(global_getreldesc);
-
- return RelationNameGetRelation(relationName);
-}
-
-#endif
-
/* ----------------------------------------------------------------
* cache invalidation support routines
* ----------------------------------------------------------------