File tree 3 files changed +14
-1
lines changed
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 \
37
37
pathman_cache_pranks \
38
38
pathman_calamity \
39
39
pathman_callbacks \
40
+ pathman_column_type \
40
41
pathman_cte \
41
42
pathman_domains \
42
43
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)
174
174
175
175
expr_cstr = TextDatumGetCString (values [Anum_pathman_config_expr - 1 ]);
176
176
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
177
181
cooked_cstr = nodeToString (expr );
182
+ #endif
178
183
179
184
pfree (expr_cstr );
180
185
pfree (expr );
@@ -196,7 +201,13 @@ get_cached_partition_cooked_key_pl(PG_FUNCTION_ARGS)
196
201
197
202
prel = get_pathman_relation_info (relid );
198
203
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
199
208
res = CStringGetTextDatum (nodeToString (prel -> expr ));
209
+ #endif
210
+
200
211
close_pathman_relation_info (prel );
201
212
202
213
PG_RETURN_DATUM (res );
Original file line number Diff line number Diff line change @@ -1491,7 +1491,8 @@ parse_partitioning_expression(const Oid relid,
1491
1491
return ((ResTarget * ) linitial (select_stmt -> targetList ))-> val ;
1492
1492
}
1493
1493
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 */
1495
1496
Node *
1496
1497
cook_partitioning_expression (const Oid relid ,
1497
1498
const char * expr_cstr ,
You can’t perform that action at this time.
0 commit comments