mirror of
https://github.com/postgres/postgres.git
synced 2025-11-19 13:42:17 +03:00
Reimplement temp tables using schemas. The temp table map is history;
temp table entries in pg_class have the names the user would expect.
This commit is contained in:
16
src/backend/utils/cache/relcache.c
vendored
16
src/backend/utils/cache/relcache.c
vendored
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.158 2002/03/26 19:16:10 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.159 2002/03/31 06:26:31 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -60,7 +60,6 @@
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/relcache.h"
|
||||
#include "utils/syscache.h"
|
||||
#include "utils/temprel.h"
|
||||
|
||||
|
||||
/*
|
||||
@@ -186,7 +185,7 @@ do { \
|
||||
nodentry->reldesc = RELATION; \
|
||||
if (RelationGetNamespace(RELATION) == PG_CATALOG_NAMESPACE) \
|
||||
{ \
|
||||
char *relname = RelationGetPhysicalRelationName(RELATION); \
|
||||
char *relname = RelationGetRelationName(RELATION); \
|
||||
RelNameCacheEnt *namehentry; \
|
||||
namehentry = (RelNameCacheEnt*)hash_search(RelationSysNameCache, \
|
||||
relname, \
|
||||
@@ -247,7 +246,7 @@ do { \
|
||||
elog(WARNING, "trying to delete a reldesc that does not exist."); \
|
||||
if (RelationGetNamespace(RELATION) == PG_CATALOG_NAMESPACE) \
|
||||
{ \
|
||||
char *relname = RelationGetPhysicalRelationName(RELATION); \
|
||||
char *relname = RelationGetRelationName(RELATION); \
|
||||
RelNameCacheEnt *namehentry; \
|
||||
namehentry = (RelNameCacheEnt*)hash_search(RelationSysNameCache, \
|
||||
relname, \
|
||||
@@ -1571,18 +1570,9 @@ RelationIdGetRelation(Oid relationId)
|
||||
Relation
|
||||
RelationSysNameGetRelation(const char *relationName)
|
||||
{
|
||||
char *temprelname;
|
||||
Relation rd;
|
||||
RelationBuildDescInfo buildinfo;
|
||||
|
||||
/*
|
||||
* 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_username(relationName);
|
||||
if (temprelname != NULL)
|
||||
relationName = temprelname;
|
||||
|
||||
/*
|
||||
* first try and get a reldesc from the cache
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user