8
8
*
9
9
*
10
10
* 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 $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -91,35 +91,24 @@ create_temp_relation(const char *relname, HeapTuple pg_class_tuple)
91
91
void
92
92
remove_all_temp_relations (void )
93
93
{
94
- List * l ,
95
- * next ;
96
-
97
- if (temp_rels == NIL )
98
- return ;
99
-
100
94
AbortOutOfAnyTransaction ();
101
95
StartTransactionCommand ();
102
96
103
- l = temp_rels ;
104
- while (l != NIL )
97
+ while (temp_rels != NIL )
105
98
{
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 );
109
101
110
- /* Indexes are dropped during heap drop */
111
102
if (temp_rel -> relkind != RELKIND_INDEX )
112
103
{
113
- char relname [NAMEDATALEN ];
114
-
115
104
/* safe from deallocation */
116
105
strcpy (relname , temp_rel -> user_relname );
117
106
heap_drop_with_catalog (relname , allowSystemTableMods );
118
107
}
119
-
120
- l = next ;
108
+ else
109
+ index_drop (temp_rel -> relid );
110
+ CommandCounterIncrement ();
121
111
}
122
- temp_rels = NIL ;
123
112
CommitTransactionCommand ();
124
113
}
125
114
@@ -129,7 +118,7 @@ remove_all_temp_relations(void)
129
118
* we don't have the relname for indexes, so we just pass the oid
130
119
*/
131
120
void
132
- remove_temp_relation (Oid relid )
121
+ remove_temp_rel_by_relid (Oid relid )
133
122
{
134
123
MemoryContext oldcxt ;
135
124
List * l ,
@@ -179,7 +168,7 @@ remove_temp_relation(Oid relid)
179
168
* We just have to delete the map entry.
180
169
*/
181
170
void
182
- invalidate_temp_relations (void )
171
+ remove_temp_rel_in_myxid (void )
183
172
{
184
173
MemoryContext oldcxt ;
185
174
List * l ,
0 commit comments