Re: Needless additional partition check in INSERT? - Mailing list pgsql-hackers

From Amit Langote
Subject Re: Needless additional partition check in INSERT?
Date
Msg-id 50a89653-78ce-6560-8d43-fc34a18af9b1@lab.ntt.co.jp
Whole thread Raw
In response to Re: Needless additional partition check in INSERT?  (David Rowley <david.rowley@2ndquadrant.com>)
Responses Re: Needless additional partition check in INSERT?  (David Rowley <david.rowley@2ndquadrant.com>)
List pgsql-hackers
Hi David.

On 2018/05/10 18:56, David Rowley wrote:
> On 10 May 2018 at 17:42, Simon Riggs <simon@2ndquadrant.com> wrote:
>> Patch is good.
>>
>> The cause of this oversight is the lack of comments to explain the
>> original coding, so we need to correct that in this patch, please.
> 
> Thanks for looking.
> 
> Yeah, the comments do need work. In order to make it a bit easier to
> document I changed the way that check_partition_constr is set. This is
> now done with an if/else if/else clause for both COPY and INSERT.
> 
> Hopefully, that's easier to understand and prevents further mistakes.
> 
> Patch attached.

Thanks.  I like this patch, both the rewording of comments and the code
revision.

By the way,

+            !resultRelInfo->ri_PartitionRoot)

This should be resultRelInfo->ri_PartitionRoot == NULL, because the above
gives an impression that ri_PartitionRoot is a Boolean.

Thanks,
Amit



pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: Should we add GUCs to allow partition pruning to be disabled?
Next
From: David Rowley
Date:
Subject: Re: Needless additional partition check in INSERT?