Re: Oddity in COPY FROM handling of check constraints on partition tables - Mailing list pgsql-hackers

From Ashutosh Bapat
Subject Re: Oddity in COPY FROM handling of check constraints on partition tables
Date
Msg-id CAFjFpReWH=JuGL2cGRabADg4PUWF3WRbGE1fAuX6uD8dBXLxOQ@mail.gmail.com
Whole thread Raw
In response to Re: Oddity in COPY FROM handling of check constraints on partitiontables  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Responses Re: Oddity in COPY FROM handling of check constraints on partitiontables  (Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>)
List pgsql-hackers
On Wed, Mar 28, 2018 at 6:58 AM, Amit Langote
<Langote_Amit_f8@lab.ntt.co.jp> wrote:
>> which violates the constraint on the column b (ie, b > 0), so this
>> should abort.  The reason for that is because CopyFrom looks at the
>> parent relation's constraints, not the partition's constraints, when
>> checking the constraint against the input row.
>
> Good catch, thanks!
>

+1

>> Attached is a patch for fixing this issue.
>
> That looks good to me.  This one would need to be back-patched to v10.
Thanks. Please add to the next commitfest so that it doesn't get lost.
We can not add this to v11 open items since it isn't a v11 bug
exactly.


-- 
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company


pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: [HACKERS] path toward faster partition pruning
Next
From: Amit Langote
Date:
Subject: Re: [HACKERS] path toward faster partition pruning