26
26
#include "catalog/namespace.h"
27
27
#include "catalog/pg_proc.h"
28
28
#include "utils/builtins.h"
29
+ #include "pgstat.h"
29
30
#include "dynloader.h"
31
+ #if PG_VERSION_NUM >= 100000
32
+ #include "utils/regproc.h"
33
+ #endif
30
34
31
35
#include "char_array.h"
32
36
#include "pgpro_scheduler.h"
@@ -285,8 +289,12 @@ void set_mtm_node_status(bool status)
285
289
286
290
new_tuple = heap_modify_tuple (
287
291
tuple , nodes_heap -> rd_att , values , nulls , replace );
292
+ #if PG_VERSION_NUM < 100000
288
293
simple_heap_update (nodes_heap , & new_tuple -> t_self , new_tuple );
289
294
CatalogUpdateIndexes (nodes_heap , new_tuple );
295
+ #else
296
+ CatalogTupleUpdate (nodes_heap , & new_tuple -> t_self , new_tuple );
297
+ #endif
290
298
heap_freetuple (new_tuple );
291
299
}
292
300
else
@@ -296,8 +304,12 @@ void set_mtm_node_status(bool status)
296
304
values [2 ] = TimestampTzGetDatum (GetCurrentTimestamp ());
297
305
298
306
tuple = heap_form_tuple (nodes_heap -> rd_att , values , nulls );
307
+ #if PG_VERSION_NUM < 100000
299
308
simple_heap_insert (nodes_heap , tuple );
300
309
CatalogUpdateIndexes (nodes_heap , tuple );
310
+ #else
311
+ CatalogTupleInsert (nodes_heap , tuple );
312
+ #endif
301
313
heap_freetuple (tuple );
302
314
}
303
315
@@ -307,7 +319,11 @@ void set_mtm_node_status(bool status)
307
319
{
308
320
if (tuple )
309
321
{
322
+ #if PG_VERSION_NUM < 100000
310
323
simple_heap_delete (nodes_heap , & tuple -> t_self );
324
+ #else
325
+ CatalogTupleDelete (nodes_heap , & tuple -> t_self );
326
+ #endif
311
327
}
312
328
}
313
329
index_endscan (indexScan );
0 commit comments