forked from vibhorkum/pg_background
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pg_background.h
44 lines (37 loc) · 1.4 KB
/
pg_background.h
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
35
36
37
38
39
40
41
42
43
44
#ifndef PG_BACKGROUND_H_
#define PG_BACKGROUND_H_
/* Various macros for backward compatbility */
/*
* TupleDescAttr was introduced in 9.6.5 and 9.5.9, so allow compilation
* against those versions just in case.
*/
#ifndef TupleDescAttr
#define TupleDescAttr(tupdesc, i) (&(tupdesc)->attrs[(i)])
#endif
#if PG_VERSION_NUM < 100000
#define shm_toc_lookup_compat(toc, key, noerr) shm_toc_lookup((toc), (key))
#else
#define shm_toc_lookup_compat(toc, key, noerr) shm_toc_lookup((toc), (key), (noerr))
#endif
#if PG_VERSION_NUM < 100000 || PG_VERSION_NUM >= 130000
#define CreateCommandTag_compat(p) CreateCommandTag((Node *) (p))
#else
#define CreateCommandTag_compat(p) CreateCommandTag((p)->stmt)
#endif
#if PG_VERSION_NUM < 130000
#define GetCommandTagName(n) (n)
#define set_ps_display_compat(tag) set_ps_display((tag), false)
#else
#define set_ps_display_compat(tag) set_ps_display((tag))
#endif
#if PG_VERSION_NUM >= 150000
#define pg_analyze_and_rewrite_compat(parse, string, types, num, env) \
pg_analyze_and_rewrite_fixedparams((parse), (string), (types), (num), (env))
#elif PG_VERSION_NUM >= 100000
#define pg_analyze_and_rewrite_compat(parse, string, types, num, env) \
pg_analyze_and_rewrite((parse), (string), (types), (num), (env))
#else
#define pg_analyze_and_rewrite_compat(parse, string, types, num, env) \
pg_analyze_and_rewrite((parse), (string), (types), (num))
#endif
#endif /* PG_BACKGROUND_H_ */