7
7
*
8
8
*
9
9
* 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 $
11
11
*
12
12
*
13
13
* INTERFACE ROUTINES
@@ -290,7 +290,7 @@ heap_create(char *relname,
290
290
* ----------------
291
291
*/
292
292
MemSet ((char * ) rel -> rd_rel , 0 , sizeof * rel -> rd_rel );
293
- strcpy (RelationGetRelationName (rel ), relname );
293
+ strcpy (RelationGetPhysicalRelationName (rel ), relname );
294
294
rel -> rd_rel -> relkind = RELKIND_UNCATALOGED ;
295
295
rel -> rd_rel -> relnatts = natts ;
296
296
if (tupDesc -> constr )
@@ -798,7 +798,7 @@ heap_create_with_catalog(char *relname,
798
798
799
799
/* temp tables can mask non-temp tables */
800
800
if ((!istemp && RelnameFindRelid (relname )) ||
801
- (istemp && get_temp_rel_by_name (relname ) != NULL ))
801
+ (istemp && get_temp_rel_by_username (relname ) != NULL ))
802
802
elog (ERROR , "Relation '%s' already exists" , relname );
803
803
804
804
/* save user relation name because heap_create changes it */
@@ -810,7 +810,7 @@ heap_create_with_catalog(char *relname,
810
810
}
811
811
812
812
/* ----------------
813
- * get_temp_rel_by_name () couldn't check the simultaneous
813
+ * get_temp_rel_by_username () couldn't check the simultaneous
814
814
* creation. Uniqueness will be really checked by unique
815
815
* indexes of system tables but we couldn't check it here.
816
816
* We have to pospone to create the disk file for this
@@ -1448,7 +1448,7 @@ heap_destroy_with_catalog(char *relname)
1448
1448
{
1449
1449
Relation rel ;
1450
1450
Oid rid ;
1451
- bool istemp = (get_temp_rel_by_name (relname ) != NULL );
1451
+ bool istemp = (get_temp_rel_by_username (relname ) != NULL );
1452
1452
1453
1453
/* ----------------
1454
1454
* Open and lock the relation.
@@ -1518,9 +1518,6 @@ heap_destroy_with_catalog(char *relname)
1518
1518
1519
1519
DeleteComments (RelationGetRelid (rel ));
1520
1520
1521
- if (istemp )
1522
- remove_temp_relation (rid );
1523
-
1524
1521
/* ----------------
1525
1522
* delete type tuple. here we want to see the effects
1526
1523
* of the deletions we just did, so we use setheapoverride().
@@ -1565,6 +1562,9 @@ heap_destroy_with_catalog(char *relname)
1565
1562
* ----------------
1566
1563
*/
1567
1564
RelationForgetRelation (rid );
1565
+
1566
+ if (istemp )
1567
+ remove_temp_relation (rid );
1568
1568
}
1569
1569
1570
1570
/*
0 commit comments