88 *
99 *
1010 * IDENTIFICATION
11- * $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/temprel.c,v 1.27 2000/07/12 18:04:45 momjian Exp $
11+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/temprel.c,v 1.28 2000/10/11 21:28:19 momjian Exp $
1212 *
1313 *-------------------------------------------------------------------------
1414 */
@@ -91,35 +91,24 @@ create_temp_relation(const char *relname, HeapTuple pg_class_tuple)
9191void
9292remove_all_temp_relations (void )
9393{
94- List * l ,
95- * next ;
96-
97- if (temp_rels == NIL )
98- return ;
99-
10094AbortOutOfAnyTransaction ();
10195StartTransactionCommand ();
10296
103- l = temp_rels ;
104- while (l != NIL )
97+ while (temp_rels != NIL )
10598{
106- TempTable * temp_rel = (TempTable * )lfirst (l );
107-
108- next = lnext (l );/* do this first, l is deallocated */
99+ char relname [NAMEDATALEN ];
100+ TempTable * temp_rel = (TempTable * )lfirst (temp_rels );
109101
110- /* Indexes are dropped during heap drop */
111102if (temp_rel -> relkind != RELKIND_INDEX )
112103{
113- char relname [NAMEDATALEN ];
114-
115104/* safe from deallocation */
116105strcpy (relname ,temp_rel -> user_relname );
117106heap_drop_with_catalog (relname ,allowSystemTableMods );
118107}
119-
120- l = next ;
108+ else
109+ index_drop (temp_rel -> relid );
110+ CommandCounterIncrement ();
121111}
122- temp_rels = NIL ;
123112CommitTransactionCommand ();
124113}
125114
@@ -129,7 +118,7 @@ remove_all_temp_relations(void)
129118 * we don't have the relname for indexes, so we just pass the oid
130119 */
131120void
132- remove_temp_relation (Oid relid )
121+ remove_temp_rel_by_relid (Oid relid )
133122{
134123MemoryContext oldcxt ;
135124List * l ,
@@ -179,7 +168,7 @@ remove_temp_relation(Oid relid)
179168 * We just have to delete the map entry.
180169 */
181170void
182- invalidate_temp_relations (void )
171+ remove_temp_rel_in_myxid (void )
183172{
184173MemoryContext oldcxt ;
185174List * l ,