Re: logical replication - Mailing list pgsql-performance

From Andrew Dunstan
Subject Re: logical replication
Date
Msg-id d7f1bac2-8549-9d8e-956d-e635960ccaa4@dunslane.net
Whole thread Raw
In response to logical replication  (Marc Millas <marc.millas@mokadb.com>)
Responses Re: logical replication
List pgsql-performance
On 5/21/21 8:41 AM, Marc Millas wrote:
> Hi,
>
> my POC in postgres 12.(important ?)
>
> if I setup 2 postgres clusters, and create a publication in one and a
> subscription in the other,
> and do on the pub an update which does not change the data (updating
> an existing record with same data) then this (useless) update go
> through replication.(ie consumes network ressource)
>
> what are ways to avoid this ?
> (I thought of a trigger to not execute the useless update, but I
> dont see how to do this)
> any ideas ?
>
> thanks
> PS: remarks about the meaning of this are off topic, thanks
>
>

Postgres provides exactly such a trigger. See
https://www.postgresql.org/docs/12/functions-trigger.html


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com




pgsql-performance by date:

Previous
From: Marc Millas
Date:
Subject: logical replication
Next
From: Marc Millas
Date:
Subject: Re: logical replication