pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Amit Langote <amitlangote09@gmail.com>
Cc: Rafia Sabih <rafia.pghackers@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: adding partitioned tables to publications
Date: Wed, 20 Nov 2019 08:55:39 +0100
Message-ID: <b1e7d3c5-d4f8-2bc6-80a1-18b18c5db347@2ndquadrant.com> (raw)
In-Reply-To: <CA+HiwqFWK3raKUU5Fp789jBsju-pYVpAiw0OsuO5sMX1CkYwFQ@mail.gmail.com>
References: <CA+HiwqH=Y85vRK3mOdjEkqFK+E=ST=eQiHdpj43L=_eJMOOznQ@mail.gmail.com>
	<CA+HiwqEF4K+SxBZkU-=q6krGD74ysZZZv5z10_2C=+UcE2vTYw@mail.gmail.com>
	<CA+FpmFf2HVQYRQNh1ZvWPwatyr8_5n4pHRzNtmD5zVqs1zoLbQ@mail.gmail.com>
	<CA+HiwqEgn5da9KvWP4y0rBjcMtHdRao01Lr6TgTw78+UGceJwQ@mail.gmail.com>
	<037d3133-1689-108c-360d-b782e3209cfb@2ndquadrant.com>
	<CA+HiwqHf8_bcyHt=6R4O_Ju4P_Wz6wu1MkOAe14URdpdafS_KQ@mail.gmail.com>
	<CA+HiwqEQb5-26-=-K=vrWKQhvn7kqOfS-Vgj+H2YMw5XtdUUQw@mail.gmail.com>
	<eed6fb07-94d6-a2a5-33e1-84679dca9363@2ndquadrant.com>
	<CA+HiwqF7JD0CLkN12KNuGsf5GfaLuVb-Nc6+nTyL_iOhrSuA0g@mail.gmail.com>
	<CA+HiwqFWK3raKUU5Fp789jBsju-pYVpAiw0OsuO5sMX1CkYwFQ@mail.gmail.com>

On 2019-11-18 09:53, Amit Langote wrote:
> I have spent some time hacking on this.  With the attached updated
> patch, adding a partitioned table to publication results in publishing
> the inserts, updates, deletes of the table's leaf partitions as
> inserts, updates, deletes of the table itself (it all happens inside
> pgoutput).  So, the replication target table doesn't necessarily have
> to be a partitioned table and even if it is partitioned its partitions
> don't have to match one-to-one.
> 
> One restriction remains though: partitioned tables on a subscriber
> can't accept updates and deletes, because we'd need to map those to
> updates and deletes of their partitions, including handling a tuple
> possibly moving from one partition to another during an update.

Right.  Without that second part, the first part isn't really that 
useful yet, is it?

I'm not sure what your intent with this patch is now.  I thought the 
previous behavior -- add a partitioned table to a publication and its 
leaf tables appear in the replication output -- was pretty welcome.  Do 
we not want that anymore?

There should probably be an option to pick the behavior, like we do in 
pg_dump.

What happens when you add a leaf table directly to a publication?  Is it 
replicated under its own identity or under its ancestor partitioned 
table?  (What if both the leaf table and a partitioned table are 
publication members?)

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





view thread (86+ messages)  latest in thread

Message-ID: <b1e7d3c5-d4f8-2bc6-80a1-18b18c5db347@2ndquadrant.com>
Permalink:  ../b1e7d3c5-d4f8-2bc6-80a1-18b18c5db347@2ndquadrant.com/
Also on:    postgresql.org/message-id/b1e7d3c5-d4f8-2bc6-80a1-18b18c5db347@2ndquadrant.com

 · 

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-hackers@postgresql.org
  Cc: peter.eisentraut@2ndquadrant.com, amitlangote09@gmail.com, rafia.pghackers@gmail.com
  Subject: Re: adding partitioned tables to publications
  In-Reply-To: <b1e7d3c5-d4f8-2bc6-80a1-18b18c5db347@2ndquadrant.com>

* 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