|
| 1 | +/* ------------------------------------------------------------------------ |
| 2 | + * |
| 3 | + * pg_compat.h |
| 4 | + * Compatibility tools |
| 5 | + * |
| 6 | + * Copyright (c) 2016, Postgres Professional |
| 7 | + * |
| 8 | + * ------------------------------------------------------------------------ |
| 9 | + */ |
| 10 | + |
| 11 | +#ifndef PG_COMPAT_H |
| 12 | +#define PG_COMPAT_H |
| 13 | + |
| 14 | +#include "postgres.h" |
| 15 | + |
| 16 | +#include "nodes/relation.h" |
| 17 | +#include "nodes/pg_list.h" |
| 18 | +#include "optimizer/cost.h" |
| 19 | +#include "optimizer/paths.h" |
| 20 | + |
| 21 | + |
| 22 | +extern void set_append_rel_size_compat(PlannerInfo *root, RelOptInfo *rel, |
| 23 | + Index rti, RangeTblEntry *rte); |
| 24 | +extern void copy_targetlist_compat(RelOptInfo *dest, RelOptInfo *rel); |
| 25 | + |
| 26 | +#if PG_VERSION_NUM >= 90600 |
| 27 | + |
| 28 | +#define get_parameterized_joinrel_size_compat(root, rel, outer_path, \ |
| 29 | + inner_path, sjinfo, \ |
| 30 | + restrict_clauses) \ |
| 31 | + get_parameterized_joinrel_size(root, rel, outer_path, \ |
| 32 | + inner_path, sjinfo, \ |
| 33 | + restrict_clauses) |
| 34 | + |
| 35 | +#define check_index_predicates_compat(rool, rel) \ |
| 36 | + check_index_predicates(root, rel) |
| 37 | + |
| 38 | +#define create_append_path_compat(rel, subpaths, required_outer, parallel_workers) \ |
| 39 | + create_append_path(rel, subpaths, required_outer, parallel_workers) |
| 40 | + |
| 41 | +#define pull_var_clause_compat(node, aggbehavior, phbehavior) \ |
| 42 | + pull_var_clause(node, aggbehavior | phbehavior) |
| 43 | + |
| 44 | +extern Result *make_result(List *tlist, Node *resconstantqual, Plan *subplan); |
| 45 | +#define make_result_compat(root, tlist, resconstantqual, subplan) \ |
| 46 | + make_result(tlist, resconstantqual, subplan) |
| 47 | + |
| 48 | +#else /* PG_VERSION_NUM >= 90500 */ |
| 49 | + |
| 50 | +#define get_parameterized_joinrel_size_compat(root, rel, \ |
| 51 | + outer_path, \ |
| 52 | + inner_path, \ |
| 53 | + sjinfo, restrict_clauses) \ |
| 54 | + get_parameterized_joinrel_size(root, rel, \ |
| 55 | + (outer_path)->rows, \ |
| 56 | + (inner_path)->rows, \ |
| 57 | + sjinfo, restrict_clauses) |
| 58 | + |
| 59 | +#define check_index_predicates_compat(rool, rel) \ |
| 60 | + check_partial_indexes(root, rel) |
| 61 | + |
| 62 | +#define create_append_path_compat(rel, subpaths, required_outer, parallel_workers) \ |
| 63 | + create_append_path(rel, subpaths, required_outer) |
| 64 | + |
| 65 | +#define pull_var_clause_compat(node, aggbehavior, phbehavior) \ |
| 66 | + pull_var_clause(node, aggbehavior, phbehavior) |
| 67 | + |
| 68 | +#define make_result_compat(root, tlist, resconstantqual, subplan) \ |
| 69 | + make_result(root, tlist, resconstantqual, subplan) |
| 70 | + |
| 71 | +#endif |
| 72 | + |
| 73 | + |
| 74 | +#endif /* PG_COMPAT_H */ |
0 commit comments