77 *
88 *
99 * IDENTIFICATION
10- * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.107 1999/11/07 23:08:00 momjian Exp $
10+ * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.108 1999/11/16 04:13:55 momjian Exp $
1111 *
1212 *
1313 * INTERFACE ROUTINES
@@ -290,7 +290,7 @@ heap_create(char *relname,
290290 * ----------------
291291 */
292292MemSet ((char * )rel -> rd_rel ,0 ,sizeof * rel -> rd_rel );
293- strcpy (RelationGetRelationName (rel ),relname );
293+ strcpy (RelationGetPhysicalRelationName (rel ),relname );
294294rel -> rd_rel -> relkind = RELKIND_UNCATALOGED ;
295295rel -> rd_rel -> relnatts = natts ;
296296if (tupDesc -> constr )
@@ -798,7 +798,7 @@ heap_create_with_catalog(char *relname,
798798
799799/* temp tables can mask non-temp tables */
800800if ((!istemp && RelnameFindRelid (relname ))||
801- (istemp && get_temp_rel_by_name (relname )!= NULL ))
801+ (istemp && get_temp_rel_by_username (relname )!= NULL ))
802802elog (ERROR ,"Relation '%s' already exists" ,relname );
803803
804804/* save user relation name because heap_create changes it */
@@ -810,7 +810,7 @@ heap_create_with_catalog(char *relname,
810810}
811811
812812/* ----------------
813- *get_temp_rel_by_name () couldn't check the simultaneous
813+ *get_temp_rel_by_username () couldn't check the simultaneous
814814 *creation. Uniqueness will be really checked by unique
815815 *indexes of system tables but we couldn't check it here.
816816 *We have to pospone to create the disk file for this
@@ -1448,7 +1448,7 @@ heap_destroy_with_catalog(char *relname)
14481448{
14491449Relation rel ;
14501450Oid rid ;
1451- bool istemp = (get_temp_rel_by_name (relname )!= NULL );
1451+ bool istemp = (get_temp_rel_by_username (relname )!= NULL );
14521452
14531453/* ----------------
14541454 *Open and lock the relation.
@@ -1518,9 +1518,6 @@ heap_destroy_with_catalog(char *relname)
15181518
15191519DeleteComments (RelationGetRelid (rel ));
15201520
1521- if (istemp )
1522- remove_temp_relation (rid );
1523-
15241521/* ----------------
15251522 *delete type tuple.here we want to see the effects
15261523 *of the deletions we just did, so we use setheapoverride().
@@ -1565,6 +1562,9 @@ heap_destroy_with_catalog(char *relname)
15651562 * ----------------
15661563 */
15671564RelationForgetRelation (rid );
1565+
1566+ if (istemp )
1567+ remove_temp_relation (rid );
15681568}
15691569
15701570/*