Re: Determining if a table really changed in a trigger

From: Mitar <mmitar(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>, Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Determining if a table really changed in a trigger
Date: 2021-11-06 20:04:56
Message-ID: CAKLmikPDTCZPuY=3bgtkZgXbVy8bfyrA_OYM0dNp4Pu2Viat-A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi!

On Sat, Nov 6, 2021 at 2:43 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Mitar <mmitar(at)gmail(dot)com> writes:
> > Anyone? Any way to determine the number of affected rows in a statement trigger?
>
> Check the size of the transition relation.

Yes, this is what we are currently doing, but it looks very
inefficient if you want just the number, no? Or even if you want to
know if it is non-zero or zero.

Mitar

--
http://mitar.tnode.com/
https://twitter.com/mitar_m

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Erik Wienhold 2021-11-07 00:02:09 Design database schemas around a common subset of objects
Previous Message Tom Lane 2021-11-06 13:43:21 Re: Determining if a table really changed in a trigger