pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew@dunslane.net>
To: Marc Millas <marc.millas@mokadb.com>
To: pgsql-performance@postgresql.org
Subject: Re: logical replication
Date: Fri, 21 May 2021 09:21:13 -0400
Message-ID: <d7f1bac2-8549-9d8e-956d-e635960ccaa4@dunslane.net> (raw)
In-Reply-To: <CADX_1aaqJiO1XU1OkXcX2j2KRt3ei97TVuXQiCuMWNFUpdXV_A@mail.gmail.com>
References: <CADX_1aaqJiO1XU1OkXcX2j2KRt3ei97TVuXQiCuMWNFUpdXV_A@mail.gmail.com>


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






view thread (3+ messages)  latest in thread

Message-ID: <d7f1bac2-8549-9d8e-956d-e635960ccaa4@dunslane.net>
Permalink:  ../d7f1bac2-8549-9d8e-956d-e635960ccaa4@dunslane.net/
Also on:    postgresql.org/message-id/d7f1bac2-8549-9d8e-956d-e635960ccaa4@dunslane.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: andrew@dunslane.net, marc.millas@mokadb.com
  Subject: Re: logical replication
  In-Reply-To: <d7f1bac2-8549-9d8e-956d-e635960ccaa4@dunslane.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox