On 2/2/18 04:39, Amit Langote wrote:
> Most of the code does treat partition bound values as Node values doing
> coercing before calling the input value good and failing upon not being
> able to convert to the desired type for whatever reason.
> create table b (a bool) partition by list (a);
> create table bt partition of b for values in (1);
> ERROR:  specified value cannot be cast to type boolean for column "a"
> LINE 1: create table bt partition of b for values in (1);
> Can you say a bit more about the compatibility issues if we extend the syntax?

Without getting into the technicial details too much, this thread
surprised me.  Why do we need to add support for each kind of constant
literal separately?  That seems wrong.

There might be other options, but one way to solve this would be to
treat partition bounds as a general expression in the grammar and then
check in post-parse analysis that it's a constant.

Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Reply via email to