Re: Needless additional partition check in INSERT?

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>, Amit Langote <amitlangote09(at)gmail(dot)com>, Amit Khandekar <amitdkhan(dot)pg(at)gmail(dot)com>
Subject: Re: Needless additional partition check in INSERT?
Date: 2018-06-07 04:05:22
Message-ID: fe4f1466-ff0e-c787-3104-dd0636a634d8@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2018/06/07 12:57, Alvaro Herrera wrote:
> On 2018-Jun-07, David Rowley wrote:
>> I'm personally not really for or against having the function. I agree
>> that it's slightly weird, but anyway, here's the patch. I'll leave it
>> up to you to which one you prefer, v3 or v4.
>
> Hm I was thinking this new function would be companion to ExecConstrains
> (a fact I used in the name I proposed,) so it'd be in the same file
> (probably right after it.)

Or we could just not have a separate function and put the logic that
determines whether or not to check the partition constraint right before
the following piece of code in ExecConstraints

if (check_partition_constraint && resultRelInfo->ri_PartitionCheck &&
!ExecPartitionCheck(resultRelInfo, slot, estate))
ExecPartitionCheckEmitError(resultRelInfo, slot, estate);

It seems that ExecConstraint receives all the information that's needed to
make that happen.

Thanks,
Amit

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2018-06-07 04:10:39 Re: Needless additional partition check in INSERT?
Previous Message Alvaro Herrera 2018-06-07 03:57:32 Re: Needless additional partition check in INSERT?