On Wed, 26 Aug 2020 at 22:47, Alvaro Herrera <alvhe...@2ndquadrant.com>
wrote:

>
> What this is saying to me is that we'd need to make sure to run the
> final target partition's AFTER triggers, not the original target
> partition.


Agreed.


>   But I'm not 100% about running the BEFORE triggers.  Maybe
> one way to address this is to check whether the BEFORE triggers in the
> new target partition are clones; if so then they would have run in the
> original target partition and so must not be run, but otherwise they
> have to.
>

This will work as long as the two BEFORE ROW triggers have the same effect.
Consider two situations resulting in inserting identical rows 1. row that
the before row trigger has redirected to a new partition, say part2 2. a
row inserted directly into the part2 - if both these rows are identical
before the BEFORE ROW triggers have been applied, they should remain
identical while inserting into part2. Any divergence might be problematic
for the application.

-- 
Best Wishes,
Ashutosh

Reply via email to