1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-29 10:41:53 +03:00

Assign collations in partition bound expressions.

Failure to do this can result in errors during evaluation of
the bound expression, as illustrated by the new regression test.

Back-patch to v12 where the ability for partition bounds to be
expressions was added.

Discussion: https://postgr.es/m/CAJV4CdrZ5mKuaEsRSbLf2URQ3h6iMtKD=hik8MaF5WwdmC9uZw@mail.gmail.com
This commit is contained in:
Tom Lane
2020-09-28 14:12:38 -04:00
parent f7873900f3
commit 61a78c71a6
3 changed files with 18 additions and 0 deletions

View File

@ -4239,7 +4239,10 @@ transformPartitionBoundValue(ParseState *pstate, Node *val,
/* Simplify the expression, in case we had a coercion */
if (!IsA(value, Const))
{
assign_expr_collations(pstate, value);
value = (Node *) expression_planner((Expr *) value);
}
/*
* transformExpr() should have already rejected column references,