1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-13 07:41:39 +03:00

Commit to make clearer distinction for temp names and real names.

Thanks to Tom Lane for ideas.
This commit is contained in:
Bruce Momjian
1999-11-16 04:14:03 +00:00
parent bf5d51e7fe
commit dc5c7713bc
9 changed files with 70 additions and 33 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/temprel.c,v 1.15 1999/11/07 23:08:26 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/temprel.c,v 1.16 1999/11/16 04:13:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -150,7 +150,6 @@ remove_temp_relation(Oid relid)
prev = l;
l = lnext(l);
}
}
MemoryContextSwitchTo(oldcxt);
@ -203,7 +202,7 @@ invalidate_temp_relations(void)
}
char *
get_temp_rel_by_name(char *user_relname)
get_temp_rel_by_username(char *user_relname)
{
List *l;
@ -216,3 +215,22 @@ get_temp_rel_by_name(char *user_relname)
}
return NULL;
}
char *
get_temp_rel_by_physicalname(char *relname)
{
List *l;
/* already physical, needed for bootstrapping temp tables */
if (strncmp(relname,"pg_temp.", strlen("pg_temp.")) == 0)
return relname;
foreach(l, temp_rels)
{
TempTable *temp_rel = lfirst(l);
if (strcmp(temp_rel->relname, relname) == 0)
return temp_rel->user_relname;
}
return NULL;
}