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

Commit650cef6

Browse files
author
Ekaterina Sokolova
committed
Fix code due to commit d20d8fbd3e4d.
1 parent92c9ec4 commit650cef6

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

‎Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ REGRESS = pathman_array_qual \
3737
pathman_cache_pranks\
3838
pathman_calamity\
3939
pathman_callbacks\
40+
pathman_column_type\
4041
pathman_cte\
4142
pathman_domains\
4243
pathman_dropped_cols\

‎src/pl_funcs.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,12 @@ get_partition_cooked_key_pl(PG_FUNCTION_ARGS)
174174

175175
expr_cstr=TextDatumGetCString(values[Anum_pathman_config_expr-1]);
176176
expr=cook_partitioning_expression(relid,expr_cstr,NULL);
177+
178+
#ifPG_VERSION_NUM >=170000/* for commit d20d8fbd3e4d */
179+
cooked_cstr=nodeToStringWithLocations(expr);
180+
#else
177181
cooked_cstr=nodeToString(expr);
182+
#endif
178183

179184
pfree(expr_cstr);
180185
pfree(expr);
@@ -196,7 +201,13 @@ get_cached_partition_cooked_key_pl(PG_FUNCTION_ARGS)
196201

197202
prel=get_pathman_relation_info(relid);
198203
shout_if_prel_is_invalid(relid,prel,PT_ANY);
204+
205+
#ifPG_VERSION_NUM >=170000/* for commit d20d8fbd3e4d */
206+
res=CStringGetTextDatum(nodeToStringWithLocations(prel->expr));
207+
#else
199208
res=CStringGetTextDatum(nodeToString(prel->expr));
209+
#endif
210+
200211
close_pathman_relation_info(prel);
201212

202213
PG_RETURN_DATUM(res);

‎src/relation_info.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1491,7 +1491,8 @@ parse_partitioning_expression(const Oid relid,
14911491
return ((ResTarget*)linitial(select_stmt->targetList))->val;
14921492
}
14931493

1494-
/* Parse partitioning expression and return its type and nodeToString() as TEXT */
1494+
/* Parse partitioning expression and return its type and nodeToString()
1495+
* (or nodeToStringWithLocations() in version 17 and higher) as TEXT */
14951496
Node*
14961497
cook_partitioning_expression(constOidrelid,
14971498
constchar*expr_cstr,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp