by eknkc · 2y ago · 0 comments
You can use a specific trigger function just to prevent this: suppress_redundant_updates_trigger
https://www.postgresql.org/docs/current/functions-trigger.ht...
> The suppress_redundant_updates_trigger function, when applied as a row-level BEFORE UPDATE trigger, will prevent any update that does not actually change the data in the row from taking place. This overrides the normal behavior which always performs a physical row update regardless of whether or not the data has changed.
It basically turns the ON CONFLICT DO UPDATE into ON CONFLICT DO NOTHING.