pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Petr Jelinek <petr.jelinek@2ndquadrant.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: [PATCH] Logical decoding of TRUNCATE
Date: Fri, 26 Jan 2018 02:36:42 +0100
Message-ID: <5c6ede4a-1d58-fbdf-1faf-af024527a579@2ndquadrant.com> (raw)
In-Reply-To: <CA+TgmoZa+7LmTdONSEQUHpF30M8nAH4-2Ub3hE_7ncuSdVTvKQ@mail.gmail.com>
References: <269bf0d2-6ac4-c032-6979-22aad6a9f5fb@2ndquadrant.it>
	<20171229195536.cdzmgllfkln6wo6t@alap3.anarazel.de>
	<CANP8+jKe2MxtH4Ck70tUY6wP=OnkkkXRt8Xkx1u6+50HM2wHvQ@mail.gmail.com>
	<35a1d60b-f66d-4001-499b-2336ca81fc6c@2ndquadrant.it>
	<fd058540-657f-7c2d-93a2-b70c4974513b@2ndquadrant.it>
	<1a4ace10-1997-6644-d17a-5a17bf250270@2ndquadrant.it>
	<28a59551-b1f5-8ed4-65cf-76d17e7ee7e6@2ndquadrant.it>
	<f45ec6eb-1dda-9b7f-6fb8-85deb40ff968@2ndquadrant.com>
	<CA+TgmoZa+7LmTdONSEQUHpF30M8nAH4-2Ub3hE_7ncuSdVTvKQ@mail.gmail.com>

On 26/01/18 02:34, Robert Haas wrote:
> On Wed, Jan 17, 2018 at 12:07 PM, Petr Jelinek
> <petr.jelinek@2ndquadrant.com> wrote:
>> The patch will cascade truncation on downstream if cascade was specified
>> on the upstream, that can potentially be dangerous and we either should
>> not do it and only truncate the tables which were truncated upstream
>> (but without restricting because of FKs), leaving the data inconsistent
>> on downstream (like we do already with DELETE or UPDATE). Or maybe make
>> it into either subscription or publication option so that user can chose
>> the behaviour here as I am sure some people will want it to cascade (but
>> the default should still IMHO be to not cascade as that's safer).
> 
> Maybe I'm not understanding what is being proposed here, but it sounds
> like you're saying that if somebody removes a bunch of data on the
> logical master, replication will remove only some of it from the
> servers to which the change is replicated.  That seems crazy.  Then
> replication can't be counted on to produce a replica.
> 

No, I was talking about extra tables that might be present on downstream
which weren't truncated on upstream.

-- 
  Petr Jelinek                  http://www.2ndQuadrant.com/
  PostgreSQL Development, 24x7 Support, Training & Services




view thread (48+ messages)  latest in thread

Message-ID: <5c6ede4a-1d58-fbdf-1faf-af024527a579@2ndquadrant.com>
Permalink:  ../5c6ede4a-1d58-fbdf-1faf-af024527a579@2ndquadrant.com/
Also on:    postgresql.org/message-id/5c6ede4a-1d58-fbdf-1faf-af024527a579@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 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: petr.jelinek@2ndquadrant.com, robertmhaas@gmail.com, marco.nenciarini@2ndquadrant.it, simon@2ndquadrant.com, pgsql-hackers@postgresql.org
  Subject: Re: [PATCH] Logical decoding of TRUNCATE
  In-Reply-To: <5c6ede4a-1d58-fbdf-1faf-af024527a579@2ndquadrant.com>
  References: <269bf0d2-6ac4-c032-6979-22aad6a9f5fb@2ndquadrant.it> <20171229195536.cdzmgllfkln6wo6t@alap3.anarazel.de> <CANP8+jKe2MxtH4Ck70tUY6wP=OnkkkXRt8Xkx1u6+50HM2wHvQ@mail.gmail.com> <35a1d60b-f66d-4001-499b-2336ca81fc6c@2ndquadrant.it> <fd058540-657f-7c2d-93a2-b70c4974513b@2ndquadrant.it> <1a4ace10-1997-6644-d17a-5a17bf250270@2ndquadrant.it> <28a59551-b1f5-8ed4-65cf-76d17e7ee7e6@2ndquadrant.it> <f45ec6eb-1dda-9b7f-6fb8-85deb40ff968@2ndquadrant.com> <CA+TgmoZa+7LmTdONSEQUHpF30M8nAH4-2Ub3hE_7ncuSdVTvKQ@mail.gmail.com> <5c6ede4a-1d58-fbdf-1faf-af024527a579@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