@@ -70,7 +70,7 @@ find_query(int query_hash,
7070}
7171
7272aqo_queries_table_rv = makeRangeVar ("public" ,"aqo_queries" ,-1 );
73- aqo_queries_heap = heap_openrv (aqo_queries_table_rv ,lockmode );
73+ aqo_queries_heap = table_openrv (aqo_queries_table_rv ,lockmode );
7474
7575query_index_rel = index_open (query_index_rel_oid ,lockmode );
7676query_index_scan = index_beginscan (aqo_queries_heap ,
@@ -102,7 +102,7 @@ find_query(int query_hash,
102102ExecDropSingleTupleTableSlot (slot );
103103index_endscan (query_index_scan );
104104index_close (query_index_rel ,lockmode );
105- heap_close (aqo_queries_heap ,lockmode );
105+ table_close (aqo_queries_heap ,lockmode );
106106
107107return find_ok ;
108108}
@@ -142,7 +142,7 @@ add_query(int query_hash, bool learn_aqo, bool use_aqo,
142142query_index_rel = index_open (query_index_rel_oid ,lockmode );
143143
144144aqo_queries_table_rv = makeRangeVar ("public" ,"aqo_queries" ,-1 );
145- aqo_queries_heap = heap_openrv (aqo_queries_table_rv ,lockmode );
145+ aqo_queries_heap = table_openrv (aqo_queries_table_rv ,lockmode );
146146
147147tuple = heap_form_tuple (RelationGetDescr (aqo_queries_heap ),
148148values ,nulls );
@@ -167,7 +167,7 @@ add_query(int query_hash, bool learn_aqo, bool use_aqo,
167167PG_END_TRY ();
168168
169169index_close (query_index_rel ,lockmode );
170- heap_close (aqo_queries_heap ,lockmode );
170+ table_close (aqo_queries_heap ,lockmode );
171171
172172CommandCounterIncrement ();
173173
@@ -207,7 +207,7 @@ update_query(int query_hash, bool learn_aqo, bool use_aqo,
207207}
208208
209209aqo_queries_table_rv = makeRangeVar ("public" ,"aqo_queries" ,-1 );
210- aqo_queries_heap = heap_openrv (aqo_queries_table_rv ,lockmode );
210+ aqo_queries_heap = table_openrv (aqo_queries_table_rv ,lockmode );
211211
212212query_index_rel = index_open (query_index_rel_oid ,lockmode );
213213query_index_scan = index_beginscan (aqo_queries_heap ,
@@ -261,7 +261,7 @@ update_query(int query_hash, bool learn_aqo, bool use_aqo,
261261ExecDropSingleTupleTableSlot (slot );
262262index_endscan (query_index_scan );
263263index_close (query_index_rel ,lockmode );
264- heap_close (aqo_queries_heap ,lockmode );
264+ table_close (aqo_queries_heap ,lockmode );
265265
266266CommandCounterIncrement ();
267267
@@ -301,7 +301,7 @@ add_query_text(int query_hash, const char *query_text)
301301aqo_query_texts_table_rv = makeRangeVar ("public" ,
302302"aqo_query_texts" ,
303303-1 );
304- aqo_query_texts_heap = heap_openrv (aqo_query_texts_table_rv ,
304+ aqo_query_texts_heap = table_openrv (aqo_query_texts_table_rv ,
305305lockmode );
306306
307307tuple = heap_form_tuple (RelationGetDescr (aqo_query_texts_heap ),
@@ -321,13 +321,13 @@ add_query_text(int query_hash, const char *query_text)
321321CommandCounterIncrement ();
322322simple_heap_delete (aqo_query_texts_heap ,& (tuple -> t_self ));
323323index_close (query_index_rel ,lockmode );
324- heap_close (aqo_query_texts_heap ,lockmode );
324+ table_close (aqo_query_texts_heap ,lockmode );
325325PG_RE_THROW ();
326326}
327327PG_END_TRY ();
328328
329329index_close (query_index_rel ,lockmode );
330- heap_close (aqo_query_texts_heap ,lockmode );
330+ table_close (aqo_query_texts_heap ,lockmode );
331331
332332CommandCounterIncrement ();
333333
@@ -378,7 +378,7 @@ load_fss(int fss_hash, int ncols, double **matrix, double *targets, int *rows)
378378}
379379
380380aqo_data_table_rv = makeRangeVar ("public" ,"aqo_data" ,-1 );
381- aqo_data_heap = heap_openrv (aqo_data_table_rv ,lockmode );
381+ aqo_data_heap = table_openrv (aqo_data_table_rv ,lockmode );
382382
383383data_index_rel = index_open (data_index_rel_oid ,lockmode );
384384data_index_scan = index_beginscan (aqo_data_heap ,
@@ -434,7 +434,7 @@ load_fss(int fss_hash, int ncols, double **matrix, double *targets, int *rows)
434434ExecDropSingleTupleTableSlot (slot );
435435index_endscan (data_index_scan );
436436index_close (data_index_rel ,lockmode );
437- heap_close (aqo_data_heap ,lockmode );
437+ table_close (aqo_data_heap ,lockmode );
438438
439439return success ;
440440}
@@ -480,7 +480,7 @@ update_fss(int fss_hash, int nrows, int ncols, double **matrix, double *targets)
480480}
481481
482482aqo_data_table_rv = makeRangeVar ("public" ,"aqo_data" ,-1 );
483- aqo_data_heap = heap_openrv (aqo_data_table_rv ,lockmode );
483+ aqo_data_heap = table_openrv (aqo_data_table_rv ,lockmode );
484484
485485tuple_desc = RelationGetDescr (aqo_data_heap );
486486
@@ -573,7 +573,7 @@ update_fss(int fss_hash, int nrows, int ncols, double **matrix, double *targets)
573573ExecDropSingleTupleTableSlot (slot );
574574index_endscan (data_index_scan );
575575index_close (data_index_rel ,lockmode );
576- heap_close (aqo_data_heap ,lockmode );
576+ table_close (aqo_data_heap ,lockmode );
577577
578578CommandCounterIncrement ();
579579
@@ -617,7 +617,7 @@ get_aqo_stat(int query_hash)
617617}
618618
619619aqo_stat_table_rv = makeRangeVar ("public" ,"aqo_query_stat" ,-1 );
620- aqo_stat_heap = heap_openrv (aqo_stat_table_rv ,heap_lock );
620+ aqo_stat_heap = table_openrv (aqo_stat_table_rv ,heap_lock );
621621
622622stat_index_rel = index_open (stat_index_rel_oid ,index_lock );
623623stat_index_scan = index_beginscan (aqo_stat_heap ,
@@ -658,7 +658,7 @@ get_aqo_stat(int query_hash)
658658ExecDropSingleTupleTableSlot (slot );
659659index_endscan (stat_index_scan );
660660index_close (stat_index_rel ,index_lock );
661- heap_close (aqo_stat_heap ,heap_lock );
661+ table_close (aqo_stat_heap ,heap_lock );
662662
663663return stat ;
664664}
@@ -704,7 +704,7 @@ update_aqo_stat(int query_hash, QueryStat *stat)
704704}
705705
706706aqo_stat_table_rv = makeRangeVar ("public" ,"aqo_query_stat" ,-1 );
707- aqo_stat_heap = heap_openrv (aqo_stat_table_rv ,lockmode );
707+ aqo_stat_heap = table_openrv (aqo_stat_table_rv ,lockmode );
708708
709709tuple_desc = RelationGetDescr (aqo_stat_heap );
710710
@@ -787,7 +787,7 @@ update_aqo_stat(int query_hash, QueryStat *stat)
787787ExecDropSingleTupleTableSlot (slot );
788788index_endscan (stat_index_scan );
789789index_close (stat_index_rel ,lockmode );
790- heap_close (aqo_stat_heap ,lockmode );
790+ table_close (aqo_stat_heap ,lockmode );
791791
792792CommandCounterIncrement ();
793793}