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

From Alvaro Herrera
Subject Re: Needless additional partition check in INSERT?
Date
Msg-id 20180608184122.opplyrcgw74pjjsh@alvherre.pgsql
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?
Re: Needless additional partition check in INSERT?
List pgsql-hackers
On 2018-Jun-09, David Rowley wrote:

> Of course, that could be fixed by adding something like "bool
> isinsert" to ExecConstraints(), so that it does not do the needless
> check on UPDATE,

Yeah, that was my actual suggestion rather than using Amit's patch
verbatim.

> but I'm strongly against the reduction in modularity.
> I quite like ExecConstraints() the way it is.

I see.

Maybe this business of sticking the partition constraint check in
ExecConstraints was a bad idea all along.  How about we rip it out and
move the responsibility of doing ExecPartitionCheck to the caller
instead?  See attached.  This whole business looks much cleaner to me
this way.


BTW, while working on this, I was a bit disturbed by the
execReplication.c changes (namely: if the partitioning is not identical
on both sides, things are likely to blow up pretty badly), but that's a
separate topic.  I didn't see any tests of logical replication with
partitioned tables ... Is the current understanding that we don't
promise those things to work terribly well together?

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Needless additional partition check in INSERT?
Next
From: Tom Lane
Date:
Subject: Re: pl/tcl function to detect when a request has been canceled