pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PALAYRET Jacques <jacques.palayret@meteo.fr>
To: pgsql-general@postgresql.org
Subject: PostgreSQL : column value filtering in Logical Replication
Date: Mon, 6 Sep 2021 14:50:55 +0200 (CEST)
Message-ID: <721432453.13505154.1630932655839.JavaMail.zimbra@meteo.fr> (raw)

Hello, 

Would it be possible to have a " Column value filtering in Logical Replication ", on the publication side ? 
Il would not be a " Column Filtering " neither a " row filtering ". It would be the possibility to send NULL (instead of the column value, for a publication table), when a where clause is unsatisfied. 
In others terms, a way to filter column values according to a logical condition. 

CREATE PUBLICATION <pub_name> [ FOR TABLE [ONLY] table_name [(colname [,…]) [WHERE (<where_clause>)] ] 
would become : 
CREATE PUBLICATION <pub_name> [ FOR TABLE [ONLY] table_name [(colname [WHERE (<col_where_clause>)] [,…]) [WHERE (<row_where_clause>)] ] 
-> The " col_where_clause " could be a where clause to filter or better a function to transform the column values. 


For example, with a col_where_clause (for column b) as : " b <= 50 " 

On publisher : 
a | b 
-----+------ 
111 | 44.4 
222 | 55.5 
333 | 33.3 

on subscriber : 
a | b 
-----+------ 
111 | 44.4 
222 | 
333 | 33.3 


Regards 
----- Météo-France ----- 
PALAYRET JACQUES 
DCSC/MBD 
jacques.palayret@meteo.fr 
Fixe : +33 561078319 

Message-ID: <721432453.13505154.1630932655839.JavaMail.zimbra@meteo.fr>
Permalink:  ../721432453.13505154.1630932655839.JavaMail.zimbra@meteo.fr/
Also on:    postgresql.org/message-id/721432453.13505154.1630932655839.JavaMail.zimbra@meteo.fr

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: jacques.palayret@meteo.fr
  Subject: Re: PostgreSQL : column value filtering in Logical Replication
  In-Reply-To: <721432453.13505154.1630932655839.JavaMail.zimbra@meteo.fr>
  References: <721432453.13505154.1630932655839.JavaMail.zimbra@meteo.fr>

* 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