1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-20 15:22:23 +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 2dfa3fea88
commit 72647ac3bf
3 changed files with 16 additions and 0 deletions

View File

@ -4209,6 +4209,7 @@ transformPartitionBoundValue(ParseState *pstate, Node *val,
*/
if (!IsA(value, Const))
{
assign_expr_collations(pstate, value);
value = (Node *) expression_planner((Expr *) value);
value = (Node *) evaluate_expr((Expr *) value, colType, colTypmod,
partCollation);