File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff 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 \
Original file line number Diff line number Diff 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+ #if PG_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+ #if PG_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 );
Original file line number Diff line number Diff 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 */
14951496Node *
14961497cook_partitioning_expression (const Oid relid ,
14971498 const char * expr_cstr ,
You can’t perform that action at this time.
0 commit comments