Re: BEFORE trigger can cause undetected partition constraint violation
Amit Langote <langote_amit_f8@lab.ntt.co.jp>
From: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Amit Langote <amitlangote09@gmail.com>,
"pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2017-06-08T00:04:24Z
Lists: pgsql-hackers
On 2017/06/08 2:07, Robert Haas wrote: > On Wed, Jun 7, 2017 at 1:23 AM, Amit Langote > <Langote_Amit_f8@lab.ntt.co.jp> wrote: >> 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. > > Cool. I think this is a sensible approach, and have committed the patch. Thanks a lot. Regards, Amit
Commits
-
Prevent BEFORE triggers from violating partitioning constraints.
- 15ce775faa42 10.0 landed
-
Fix failure to enforce partitioning contraint for internal partitions.
- 39162b2030fb 10.0 cited