Re: Boolean partitions syntax - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Boolean partitions syntax
Date
Msg-id 1b9e7eb1-cd8b-9e7a-4291-5ed664b5a675@2ndquadrant.com
Whole thread Raw
In response to Re: Boolean partitions syntax  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Responses Re: Boolean partitions syntax
Re: Boolean partitions syntax
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: [HACKERS] Parallel tuplesort (for parallel B-Tree index creation)
Next
From: Andres Freund
Date:
Subject: Re: [HACKERS] Parallel tuplesort (for parallel B-Tree index creation)