Re: [HACKERS] BEFORE trigger can cause undetected partitionconstraint violation - Mailing list pgsql-hackers

From Amit Langote
Subject Re: [HACKERS] BEFORE trigger can cause undetected partitionconstraint violation
Date
Msg-id d989bc07-36b0-74c9-d2bb-c9a97749f0a4@lab.ntt.co.jp
Whole thread Raw
In response to Re: [HACKERS] BEFORE trigger can cause undetected partitionconstraint violation  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Responses Re: [HACKERS] BEFORE trigger can cause undetected partitionconstraint violation  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On 2017/06/07 11:57, Amit Langote wrote:
> How about we export ExecPartitionCheck() out of execMain.c and call it
> just before ExecFindPartition() using the root table's ResultRelInfo?

Turns out there wasn't a need to export ExecPartitionCheck after all.
Instead of calling it from execModifyTable.c and copy.c, it's better to
call it at the beginning of ExecFindPartition() itself.  That way, there
is no need to add the same code both in CopyFrom() and ExecInsert(), nor
is there need to make ExecPartitionCheck() public.  That's how the patch
attached with the previous email does it anyway.

Thanks,
Amit




pgsql-hackers by date:

Previous
From: Neha Khatri
Date:
Subject: Re: [HACKERS] PG 10 release notes
Next
From: Michael Paquier
Date:
Subject: Re: [HACKERS] Notes on testing Postgres 10b1