65
65
*/
66
66
#if PG_VERSION_NUM >= 110000
67
67
#define calc_nestloop_required_outer_compat (outer , inner ) \
68
- calc_nestloop_required_outer((outer)->parent->relids, PATH_REQ_OUTER(outer), \
68
+ calc_nestloop_required_outer((outer)->parent->relids, PATH_REQ_OUTER(outer), \
69
69
(inner)->parent->relids, PATH_REQ_OUTER(inner))
70
70
#else
71
71
#define calc_nestloop_required_outer_compat (outer , inner ) \
72
- calc_nestloop_required_outer((outer), (inner))
72
+ calc_nestloop_required_outer((outer), (inner))
73
73
#endif
74
74
75
75
119
119
/*
120
120
* CheckValidResultRel()
121
121
*/
122
- #if PG_VERSION_NUM >= 100000
123
- #define CheckValidResultRelCompat (rri , cmd ) \
124
- CheckValidResultRel((rri), (cmd))
122
+ #if PG_VERSION_NUM >= 170000
123
+ #define CheckValidResultRelCompat (rri , cmd ) \
124
+ CheckValidResultRel((rri), (cmd), NIL)
125
+ #elif PG_VERSION_NUM >= 100000
126
+ #define CheckValidResultRelCompat (rri , cmd ) \
127
+ CheckValidResultRel((rri), (cmd))
125
128
#elif PG_VERSION_NUM >= 90500
126
- #define CheckValidResultRelCompat (rri , cmd ) \
127
- CheckValidResultRel((rri)->ri_RelationDesc, (cmd))
129
+ #define CheckValidResultRelCompat (rri , cmd ) \
130
+ CheckValidResultRel((rri)->ri_RelationDesc, (cmd))
128
131
#endif
129
132
130
133
/*
237
240
#endif
238
241
239
242
240
- /*
241
- * CheckValidResultRel()
242
- */
243
- #if PG_VERSION_NUM >= 100000
244
- #define CheckValidResultRelCompat (rri , cmd ) \
245
- CheckValidResultRel((rri), (cmd))
246
- #elif PG_VERSION_NUM >= 90500
247
- #define CheckValidResultRelCompat (rri , cmd ) \
248
- CheckValidResultRel((rri)->ri_RelationDesc, (cmd))
249
- #endif
250
-
251
-
252
243
/*
253
244
* create_append_path()
254
245
*/
274
265
#define create_append_path_compat (rel , subpaths , required_outer , parallel_workers ) \
275
266
create_append_path(NULL, (rel), (subpaths), NIL, NIL, (required_outer), \
276
267
(parallel_workers), false, NIL, -1, false)
277
- #endif /* PGPRO_VERSION */
268
+ #endif /* PGPRO_VERSION */
278
269
279
270
#elif PG_VERSION_NUM >= 110000
280
271
286
277
#define create_append_path_compat (rel , subpaths , required_outer , parallel_workers ) \
287
278
create_append_path(NULL, (rel), (subpaths), NIL, (required_outer), \
288
279
(parallel_workers), false, NIL, -1, false, NIL)
289
- #endif /* PGPRO_VERSION */
280
+ #endif /* PGPRO_VERSION */
290
281
291
282
#elif PG_VERSION_NUM >= 100000
292
283
297
288
#define create_append_path_compat (rel , subpaths , required_outer , parallel_workers ) \
298
289
create_append_path((rel), (subpaths), (required_outer), (parallel_workers), NIL, \
299
290
false, NIL)
300
- #endif /* PGPRO_VERSION */
291
+ #endif /* PGPRO_VERSION */
301
292
302
293
#elif PG_VERSION_NUM >= 90600
303
294
308
299
#define create_append_path_compat (rel , subpaths , required_outer , parallel_workers ) \
309
300
create_append_path((rel), (subpaths), (required_outer), \
310
301
false, NIL, (parallel_workers))
311
- #endif /* PGPRO_VERSION */
302
+ #endif /* PGPRO_VERSION */
312
303
313
304
#elif PG_VERSION_NUM >= 90500
314
305
#define create_append_path_compat (rel , subpaths , required_outer , parallel_workers ) \
315
306
create_append_path((rel), (subpaths), (required_outer))
316
- #endif /* PG_VERSION_NUM */
307
+ #endif /* PG_VERSION_NUM */
317
308
318
309
319
310
/*
@@ -423,8 +414,8 @@ extern void create_plain_partial_paths(PlannerInfo *root,
423
414
static inline Datum
424
415
ExecEvalExprCompat (ExprState * expr , ExprContext * econtext , bool * isnull )
425
416
{
426
- ExprDoneCond isdone ;
427
- Datum result = ExecEvalExpr (expr , econtext , isnull , & isdone );
417
+ ExprDoneCond isdone ;
418
+ Datum result = ExecEvalExpr (expr , econtext , isnull , & isdone );
428
419
429
420
if (isdone != ExprSingleResult )
430
421
elog (ERROR , "expression should return single value" );
@@ -441,9 +432,9 @@ ExecEvalExprCompat(ExprState *expr, ExprContext *econtext, bool *isnull)
441
432
static inline bool
442
433
ExecCheck (ExprState * state , ExprContext * econtext )
443
434
{
444
- Datum ret ;
445
- bool isnull ;
446
- MemoryContext old_mcxt ;
435
+ Datum ret ;
436
+ bool isnull ;
437
+ MemoryContext old_mcxt ;
447
438
448
439
/* short-circuit (here and in ExecInitCheck) for empty restriction list */
449
440
if (state == NULL )
@@ -539,7 +530,7 @@ extern List *get_all_actual_clauses(List *restrictinfo_list);
539
530
* get_rel_persistence()
540
531
*/
541
532
#if PG_VERSION_NUM >= 90500 && PG_VERSION_NUM < 90600
542
- char get_rel_persistence (Oid relid );
533
+ char get_rel_persistence (Oid relid );
543
534
#endif
544
535
545
536
@@ -592,8 +583,8 @@ char get_rel_persistence(Oid relid);
592
583
* make_restrictinfo()
593
584
*/
594
585
#if PG_VERSION_NUM >= 100000
595
- extern List * make_restrictinfos_from_actual_clauses (PlannerInfo * root ,
596
- List * clause_list );
586
+ extern List * make_restrictinfos_from_actual_clauses (PlannerInfo * root ,
587
+ List * clause_list );
597
588
#endif
598
589
599
590
@@ -616,17 +607,17 @@ extern Result *make_result(List *tlist,
616
607
* McxtStatsInternal()
617
608
*/
618
609
#if PG_VERSION_NUM >= 90600
619
- void McxtStatsInternal (MemoryContext context , int level ,
620
- bool examine_children ,
621
- MemoryContextCounters * totals );
610
+ void McxtStatsInternal (MemoryContext context , int level ,
611
+ bool examine_children ,
612
+ MemoryContextCounters * totals );
622
613
#endif
623
614
624
615
625
616
/*
626
617
* oid_cmp()
627
618
*/
628
619
#if PG_VERSION_NUM >=90500 && PG_VERSION_NUM < 100000
629
- extern int oid_cmp (const void * p1 , const void * p2 );
620
+ extern int oid_cmp (const void * p1 , const void * p2 );
630
621
#endif
631
622
632
623
@@ -635,7 +626,7 @@ extern int oid_cmp(const void *p1, const void *p2);
635
626
*
636
627
* for v10 cast first arg to RawStmt type
637
628
*/
638
- #if PG_VERSION_NUM >= 150000 /* for commit 791b1b71da35 */
629
+ #if PG_VERSION_NUM >= 150000 /* for commit 791b1b71da35 */
639
630
#define parse_analyze_compat (parse_tree , query_string , param_types , nparams , \
640
631
query_env ) \
641
632
parse_analyze_fixedparams((RawStmt *) (parse_tree), (query_string), (param_types), \
@@ -658,7 +649,7 @@ extern int oid_cmp(const void *p1, const void *p2);
658
649
*
659
650
* for v10 cast first arg to RawStmt type
660
651
*/
661
- #if PG_VERSION_NUM >= 150000 /* for commit 791b1b71da35 */
652
+ #if PG_VERSION_NUM >= 150000 /* for commit 791b1b71da35 */
662
653
#define pg_analyze_and_rewrite_compat (parsetree , query_string , param_types , \
663
654
nparams , query_env ) \
664
655
pg_analyze_and_rewrite_fixedparams((RawStmt *) (parsetree), (query_string), \
@@ -731,7 +722,7 @@ extern int oid_cmp(const void *p1, const void *p2);
731
722
* set_dummy_rel_pathlist()
732
723
*/
733
724
#if PG_VERSION_NUM >= 90500 && PG_VERSION_NUM < 90600
734
- void set_dummy_rel_pathlist (RelOptInfo * rel );
725
+ void set_dummy_rel_pathlist (RelOptInfo * rel );
735
726
#endif
736
727
737
728
@@ -753,8 +744,9 @@ extern void set_rel_consider_parallel(PlannerInfo *root,
753
744
* in compat version the type of first argument is (Expr *)
754
745
*/
755
746
#if PG_VERSION_NUM >= 100000
756
- #if PG_VERSION_NUM >= 140000 /* function removed in 375398244168add84a884347625d14581a421e71 */
757
- extern TargetEntry * tlist_member_ignore_relabel (Expr * node , List * targetlist );
747
+ #if PG_VERSION_NUM >= 140000 /* function removed in
748
+ * 375398244168add84a884347625d14581a421e71 */
749
+ extern TargetEntry * tlist_member_ignore_relabel (Expr * node , List * targetlist );
758
750
#endif
759
751
#define tlist_member_ignore_relabel_compat (expr , targetlist ) \
760
752
tlist_member_ignore_relabel((expr), (targetlist))
@@ -784,7 +776,7 @@ extern AttrNumber *convert_tuples_by_name_map(TupleDesc indesc,
784
776
tupleid , fdw_trigtuple , newslot ) \
785
777
ExecBRUpdateTriggers((estate), (epqstate), (relinfo), (tupleid), \
786
778
(fdw_trigtuple), (newslot), NULL, NULL)
787
- #elif PG_VERSION_NUM >= 150000 /* for commit 7103ebb7aae8 */
779
+ #elif PG_VERSION_NUM >= 150000 /* for commit 7103ebb7aae8 */
788
780
#define ExecBRUpdateTriggersCompat (estate , epqstate , relinfo , \
789
781
tupleid , fdw_trigtuple , newslot ) \
790
782
ExecBRUpdateTriggers((estate), (epqstate), (relinfo), (tupleid), \
@@ -835,7 +827,7 @@ extern AttrNumber *convert_tuples_by_name_map(TupleDesc indesc,
835
827
/*
836
828
* ExecARDeleteTriggers()
837
829
*/
838
- #if PG_VERSION_NUM >= 150000 /* for commit ba9a7e392171 */
830
+ #if PG_VERSION_NUM >= 150000 /* for commit ba9a7e392171 */
839
831
#define ExecARDeleteTriggersCompat (estate , relinfo , tupleid , \
840
832
fdw_trigtuple , transition_capture ) \
841
833
ExecARDeleteTriggers((estate), (relinfo), (tupleid), \
@@ -979,9 +971,9 @@ extern AttrNumber *convert_tuples_by_name_map(TupleDesc indesc,
979
971
* we need access to entire tuple, not just its header.
980
972
*/
981
973
#ifdef XID_IS_64BIT
982
- # define HeapTupleGetXminCompat (htup ) HeapTupleGetXmin(htup)
974
+ #define HeapTupleGetXminCompat (htup ) HeapTupleGetXmin(htup)
983
975
#else
984
- # define HeapTupleGetXminCompat (htup ) HeapTupleHeaderGetXmin((htup)->t_data)
976
+ #define HeapTupleGetXminCompat (htup ) HeapTupleHeaderGetXmin((htup)->t_data)
985
977
#endif
986
978
987
979
/*
@@ -1124,9 +1116,10 @@ static inline TupleTableSlot *
1124
1116
ExecInitExtraTupleSlotCompatHorse (EState * s , TupleDesc t )
1125
1117
{
1126
1118
#if PG_VERSION_NUM >= 110000
1127
- return ExecInitExtraTupleSlot (s ,t );
1119
+ return ExecInitExtraTupleSlot (s , t );
1128
1120
#else
1129
- TupleTableSlot * res = ExecInitExtraTupleSlot (s );
1121
+ TupleTableSlot * res = ExecInitExtraTupleSlot (s );
1122
+
1130
1123
if (t )
1131
1124
ExecSetSlotDescriptor (res , t );
1132
1125
@@ -1158,7 +1151,7 @@ CustomEvalParamExternCompat(Param *param,
1158
1151
return prm ;
1159
1152
}
1160
1153
1161
- void set_append_rel_size_compat (PlannerInfo * root , RelOptInfo * rel , Index rti );
1154
+ void set_append_rel_size_compat (PlannerInfo * root , RelOptInfo * rel , Index rti );
1162
1155
1163
1156
/*
1164
1157
* lnext()
@@ -1219,8 +1212,8 @@ void set_append_rel_size_compat(PlannerInfo *root, RelOptInfo *rel, Index rti);
1219
1212
#define make_restrictinfo_compat (r , c , ipd , od , p , sl , rr , or , nr ) make_restrictinfo((r), (c), (ipd), (od), (p), (sl), (rr), (or), (nr))
1220
1213
#else
1221
1214
#define make_restrictinfo_compat (r , c , ipd , od , p , sl , rr , or , nr ) make_restrictinfo((c), (ipd), (od), (p), (sl), (rr), (or), (nr))
1222
- #endif /* #if PG_VERSION_NUM >= 140000 */
1223
- #endif /* #if PG_VERSION_NUM >= 160000 */
1215
+ #endif /* #if PG_VERSION_NUM >= 140000 */
1216
+ #endif /* #if PG_VERSION_NUM >= 160000 */
1224
1217
1225
1218
/*
1226
1219
* pull_varnos()
@@ -1252,4 +1245,4 @@ void set_append_rel_size_compat(PlannerInfo *root, RelOptInfo *rel, Index rti);
1252
1245
#define EvalPlanQualInit_compat (epqstate , parentestate , subplan , auxrowmarks , epqParam ) EvalPlanQualInit(epqstate, parentestate, subplan, auxrowmarks, epqParam)
1253
1246
#endif
1254
1247
1255
- #endif /* PG_COMPAT_H */
1248
+ #endif /* PG_COMPAT_H */
0 commit comments