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:
@ -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,
|
||||
|
Reference in New Issue
Block a user