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

Commit 5d43c57

Browse files
committed
canonicalize user's partitioning expression in add_to_pathman_config()
1 parent 65786ab commit 5d43c57

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/pl_funcs.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "nodes/nodeFuncs.h"
3333
#include "utils/builtins.h"
3434
#include "utils/inval.h"
35+
#include "utils/ruleutils.h"
3536
#include "utils/snapmgr.h"
3637
#include "utils/lsyscache.h"
3738
#include "utils/syscache.h"
@@ -781,6 +782,11 @@ add_to_pathman_config(PG_FUNCTION_ARGS)
781782
/* Parse and check expression */
782783
expr_datum = cook_partitioning_expression(relid, expression, &expr_type);
783784

785+
/* Canonicalize user's expression (trim whitespaces etc) */
786+
expression = deparse_expression(stringToNode(TextDatumGetCString(expr_datum)),
787+
deparse_context_for(get_rel_name(relid), relid),
788+
false, false);
789+
784790
/* Check hash function for HASH partitioning */
785791
if (parttype == PT_HASH)
786792
{

0 commit comments

Comments
 (0)