Re: Determine in a trigger if UPDATE query really changed anything

From: Mitar <mmitar(at)gmail(dot)com>
To: George Neuner <gneuner2(at)comcast(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Determine in a trigger if UPDATE query really changed anything
Date: 2018-12-24 08:46:39
Message-ID: CAKLmikO_5J1k2e5smCPW=yaQKZLznNGtuO8xsSAbaL0zBDb4vg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi!

On Mon, Dec 24, 2018 at 12:31 AM George Neuner <gneuner2(at)comcast(dot)net> wrote:
> You're still thinking in terms of deltas for the whole table. Think
> individual rows instead.
>
> With a BY ROW trigger, the difference between the NEW and OLD
> variables lets you see the changes to the particular row.

I was thinking of the statement trigger because I thought this is what
works on materialized views. Now I see that this is not true anyway.

But still, I am using these triggers to do a materialized view
refresh. I would prefer to do those at the statement level and not at
the row level? So that I run the refresh only once per base table
changes. For pushing notification this can be done at the row level.

Mitar

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mitar 2018-12-24 09:01:08 Re: Watching for view changes
Previous Message George Neuner 2018-12-24 08:31:03 Re: Determine in a trigger if UPDATE query really changed anything