-
Notifications
You must be signed in to change notification settings - Fork 705
Expand file tree
/
Copy pathpg_version_compat.h
More file actions
34 lines (29 loc) · 1007 Bytes
/
pg_version_compat.h
File metadata and controls
34 lines (29 loc) · 1007 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once
#define PG_VERSION_NUM_17 170000
#define PG_VERSION_NUM_18 180000
extern "C" {
#if PG_VERSION_NUM >= PG_VERSION_NUM_18
#include <access/cmptype.h>
#include <commands/explain_format.h>
#endif
}
// Ordering operator compatibility
#if PG_VERSION_NUM >= PG_VERSION_NUM_18
#define PG_GET_OP_BTREE_INTERPRETATION get_op_index_interpretation
#define OpBtreeInterpretation OpIndexInterpretation
#define OpBtreeInterpretationGetStrategy(interp) ((interp)->cmptype)
#else
#define PG_GET_OP_BTREE_INTERPRETATION get_op_btree_interpretation
#define OpBtreeInterpretationGetStrategy(interp) ((interp)->strategy)
#endif
// Explain compatibility
#if PG_VERSION_NUM >= PG_VERSION_NUM_18
#define PG_EXPLAIN_PROPERTY_TEXT(name, value, es) ExplainPropertyValue(name, value, es)
#else
#define PG_EXPLAIN_PROPERTY_TEXT(name, value, es) ExplainPropertyText(name, value, es)
#endif
#if PG_VERSION_NUM >= PG_VERSION_NUM_18
using StrategyCompareType = CompareType;
#else
using StrategyCompareType = int16_t;
#endif