Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

PGPRO-6857: fix build for PostgreSQL 15 #249

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 32 additions & 3 deletions src/include/compat/pg_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,12 @@ extern int oid_cmp(const void *p1, const void *p2);
*
* for v10 cast first arg to RawStmt type
*/
#if PG_VERSION_NUM >= 100000
#if PG_VERSION_NUM >= 150000 /* for commit 791b1b71da35 */
#define parse_analyze_compat(parse_tree, query_string, param_types, nparams, \
query_env) \
parse_analyze_fixedparams((RawStmt *) (parse_tree), (query_string), (param_types), \
(nparams), (query_env))
#elif PG_VERSION_NUM >= 100000
#define parse_analyze_compat(parse_tree, query_string, param_types, nparams, \
query_env) \
parse_analyze((RawStmt *) (parse_tree), (query_string), (param_types), \
Expand All @@ -653,7 +658,12 @@ extern int oid_cmp(const void *p1, const void *p2);
*
* for v10 cast first arg to RawStmt type
*/
#if PG_VERSION_NUM >= 100000
#if PG_VERSION_NUM >= 150000 /* for commit 791b1b71da35 */
#define pg_analyze_and_rewrite_compat(parsetree, query_string, param_types, \
nparams, query_env) \
pg_analyze_and_rewrite_fixedparams((RawStmt *) (parsetree), (query_string), \
(param_types), (nparams), (query_env))
#elif PG_VERSION_NUM >= 100000
#define pg_analyze_and_rewrite_compat(parsetree, query_string, param_types, \
nparams, query_env) \
pg_analyze_and_rewrite((RawStmt *) (parsetree), (query_string), \
Expand Down Expand Up @@ -766,6 +776,20 @@ extern AttrNumber *convert_tuples_by_name_map(TupleDesc indesc,
#include "access/tupconvert.h"
#endif

/*
* ExecBRUpdateTriggers()
*/
#if PG_VERSION_NUM >= 150000 /* for commit 7103ebb7aae8 */
#define ExecBRUpdateTriggersCompat(estate, epqstate, relinfo, \
tupleid, fdw_trigtuple, newslot) \
ExecBRUpdateTriggers((estate), (epqstate), (relinfo), (tupleid), \
(fdw_trigtuple), (newslot), NULL)
#else
#define ExecBRUpdateTriggersCompat(estate, epqstate, relinfo, \
tupleid, fdw_trigtuple, newslot) \
ExecBRUpdateTriggers((estate), (epqstate), (relinfo), (tupleid), \
(fdw_trigtuple), (newslot))
#endif

/*
* ExecARInsertTriggers()
Expand Down Expand Up @@ -801,7 +825,12 @@ extern AttrNumber *convert_tuples_by_name_map(TupleDesc indesc,
/*
* ExecARDeleteTriggers()
*/
#if PG_VERSION_NUM >= 100000
#if PG_VERSION_NUM >= 150000 /* for commit ba9a7e392171 */
#define ExecARDeleteTriggersCompat(estate, relinfo, tupleid, \
fdw_trigtuple, transition_capture) \
ExecARDeleteTriggers((estate), (relinfo), (tupleid), \
(fdw_trigtuple), (transition_capture), false)
#elif PG_VERSION_NUM >= 100000
#define ExecARDeleteTriggersCompat(estate, relinfo, tupleid, \
fdw_trigtuple, transition_capture) \
ExecARDeleteTriggers((estate), (relinfo), (tupleid), \
Expand Down
6 changes: 3 additions & 3 deletions src/partition_creation.c
Original file line number Diff line number Diff line change
Expand Up @@ -1671,14 +1671,14 @@ make_constraint_common(char *name, Node *raw_expr)
return constraint;
}

#if PG_VERSION_NUM >= 150000 /* reason: commit 639a86e36aae */
#if PG_VERSION_NUM >= 150000 /* for commits 639a86e36aae, c4cc2850f4d1 */
static String
make_string_value_struct(char* str)
{
String val;

val.type = T_String;
val.val = str;
val.sval = str;

return val;
}
Expand All @@ -1689,7 +1689,7 @@ make_int_value_struct(int int_val)
Integer val;

val.type = T_Integer;
val.val = int_val;
val.ival = int_val;

return val;
}
Expand Down
2 changes: 1 addition & 1 deletion src/partition_router.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ router_lock_or_delete_tuple(PartitionRouterState *state,
rri->ri_TrigDesc->trig_update_before_row)
{
#if PG_VERSION_NUM >= 120000
if (!ExecBRUpdateTriggers(estate, epqstate, rri, tupleid, NULL, slot))
if (!ExecBRUpdateTriggersCompat(estate, epqstate, rri, tupleid, NULL, slot))
return NULL;
#else
slot = ExecBRUpdateTriggers(estate, epqstate, rri, tupleid, NULL, slot);
Expand Down