Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit90e90e9

Browse files
committed
Changes for PostgreSQL v15
1 parent7df6cdf commit90e90e9

File tree

2 files changed

+51
-2
lines changed

2 files changed

+51
-2
lines changed

‎src/hooks.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,11 @@ pathman_join_pathlist_hook(PlannerInfo *root,
293293
* Currently we use get_parameterized_joinrel_size() since
294294
* it works just fine, but this might change some day.
295295
*/
296+
#ifPG_VERSION_NUM >=150000/* reason: commit 18fea737b5e4 */
297+
nest_path->jpath.path.rows=
298+
#else
296299
nest_path->path.rows=
300+
#endif
297301
get_parameterized_joinrel_size_compat(root,joinrel,
298302
outer,inner,
299303
extra->sjinfo,

‎src/partition_creation.c

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,13 @@ static void postprocess_child_table_and_atts(Oid parent_relid, Oid partition_rel
9292
staticOidtext_to_regprocedure(text*proname_args);
9393

9494
staticConstraint*make_constraint_common(char*name,Node*raw_expr);
95-
staticValuemake_string_value_struct(char*str);
95+
#ifPG_VERSION_NUM >=150000/* reason: commit 639a86e36aae */
96+
staticStringmake_string_value_struct(char*str);
97+
staticIntegermake_int_value_struct(intint_val);
98+
#else
99+
staticValuemake_string_value_struct(char*str);
96100
staticValuemake_int_value_struct(intint_val);
101+
#endif
97102

98103
staticNode*build_partitioning_expression(Oidparent_relid,
99104
Oid*expr_type,
@@ -1356,12 +1361,21 @@ build_raw_range_check_tree(Node *raw_expression,
13561361
constBound*end_value,
13571362
Oidvalue_type)
13581363
{
1364+
#ifPG_VERSION_NUM >=150000/* reason: commit 639a86e36aae */
1365+
#defineBuildConstExpr(node,value,value_type) \
1366+
do { \
1367+
(node)->val.sval = make_string_value_struct( \
1368+
datum_to_cstring((value), (value_type))); \
1369+
(node)->location = -1; \
1370+
} while (0)
1371+
#else
13591372
#defineBuildConstExpr(node,value,value_type) \
13601373
do { \
13611374
(node)->val = make_string_value_struct( \
13621375
datum_to_cstring((value), (value_type))); \
13631376
(node)->location = -1; \
13641377
} while (0)
1378+
#endif
13651379

13661380
#defineBuildCmpExpr(node,opname,expr,c) \
13671381
do { \
@@ -1554,11 +1568,19 @@ build_raw_hash_check_tree(Node *raw_expression,
15541568
hash_proc=tce->hash_proc;
15551569

15561570
/* Total amount of partitions */
1571+
#ifPG_VERSION_NUM >=150000/* reason: commit 639a86e36aae */
1572+
part_count_c->val.ival=make_int_value_struct(part_count);
1573+
#else
15571574
part_count_c->val=make_int_value_struct(part_count);
1575+
#endif
15581576
part_count_c->location=-1;
15591577

15601578
/* Index of this partition (hash % total amount) */
1579+
#ifPG_VERSION_NUM >=150000/* reason: commit 639a86e36aae */
1580+
part_idx_c->val.ival=make_int_value_struct(part_idx);
1581+
#else
15611582
part_idx_c->val=make_int_value_struct(part_idx);
1583+
#endif
15621584
part_idx_c->location=-1;
15631585

15641586
/* Call hash_proc() */
@@ -1649,6 +1671,29 @@ make_constraint_common(char *name, Node *raw_expr)
16491671
returnconstraint;
16501672
}
16511673

1674+
#ifPG_VERSION_NUM >=150000/* reason: commit 639a86e36aae */
1675+
staticString
1676+
make_string_value_struct(char*str)
1677+
{
1678+
Stringval;
1679+
1680+
val.type=T_String;
1681+
val.val=str;
1682+
1683+
returnval;
1684+
}
1685+
1686+
staticInteger
1687+
make_int_value_struct(intint_val)
1688+
{
1689+
Integerval;
1690+
1691+
val.type=T_Integer;
1692+
val.val=int_val;
1693+
1694+
returnval;
1695+
}
1696+
#else
16521697
staticValue
16531698
make_string_value_struct(char*str)
16541699
{
@@ -1670,7 +1715,7 @@ make_int_value_struct(int int_val)
16701715

16711716
returnval;
16721717
}
1673-
1718+
#endif/* PG_VERSION_NUM >= 150000 */
16741719

16751720
/*
16761721
* ---------------------

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp