Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eesx7-0005Q8-Db for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Jan 2018 01:37:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eesx6-0005qS-VT for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Jan 2018 01:37:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eeswj-0002Bx-CH for pgsql-hackers@lists.postgresql.org; Fri, 26 Jan 2018 01:36:49 +0000 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eeswf-0007in-HK for pgsql-hackers@postgresql.org; Fri, 26 Jan 2018 01:36:48 +0000 Received: by mail-wr0-x241.google.com with SMTP id s5so8143408wra.0 for ; Thu, 25 Jan 2018 17:36:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=t68v+FOqmIIUT3FZMx+J2u6bM0TOz7N/RH41v/JLkTQ=; b=DEUQS+DLfxEdGDsFqS0wsPF3jtaFtST3XPBgKiChzWT7Bieg9s3472mXr4DsPtVNp6 XLeWrpRKnaq81Wykqo19moKtS/qFDTnxliCyESlv4f0Hf1Bzoq8AIH35/3CmkH/ZQRQ1 MOSmNRhmbO6Td48pmdeLsj7wIYa0KyDWZHeP58zKs/mbirLyGb9tWfT5KMM1MYBPcL0o 5MulBR87tlwtv95Fbz+NWa9G3iUBJ4XPJjRd/hpqCRFjF21GtE2I0oWBLZqGwj+rXXS8 CfwPG5SGEOgNzK3x/QQOe4PRrA0MWoKmFw5B/PO1CL/6IBfsNSLoFicg8Iq+/ygF0Zmk PvMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=t68v+FOqmIIUT3FZMx+J2u6bM0TOz7N/RH41v/JLkTQ=; b=pn4Z23oqhF4+4Mf6lWM0X+62sMhOe+ecIfMiEMr+ggKPW14PykDZnNL7wsLvqh5uo9 9jms+9sc5jecRV/JqEouEQ1icoNmmvMFgJ7/zJ/Ce/IBJg1BMxI7D/6I1fP5CGYOJoYO uZeMR0ciupeGJeH07PTwP628G1QgaarK0wokZMRHSJ4to06dmXZnQPtpBER+JS8vpD9t Lc0GJjfZ+ibAtn8EmDGivwfWNxABFn6w2PHxesJwq1NVEClLn/hSjmNb0cmjLWFWhCxT dvyjxKhpgbgnNFtoiNuf6b5ugLnlVzwcuOlptkPGVIpdCQ+FK2qE4CtKrT32ZAIR7z/r rgGQ== X-Gm-Message-State: AKwxytcE8kYGgLXmNgphUX1oHXFeb/EnGDga+H7WLHFXeiJJlhkxs6zT A5izOgY6RFS4TZpT7+r68pP0CH1RNnjRgJwVB9zWbcubILhlLxxmDaDSucty8y0KaMPMYhaZIfI D6fgYe30jTGC49reNhCTbBE7nXnV0PIEqPAXJhzImQhTqSbwIcMBjcyaD9HmtGUhMaQtlyTJZvy Zw7Bhr0vi0AuY= X-Google-Smtp-Source: AH8x225kSkaV5pHGPIgBMCmOlNU7zmr78oBGFzmjxf9sCIROyAJTrLtYw3ZdiKtHaRipMlpsNeShPw== X-Received: by 10.223.190.15 with SMTP id n15mr10432429wrh.38.1516930604365; Thu, 25 Jan 2018 17:36:44 -0800 (PST) Received: from [192.168.0.106] (150.123.broadband11.iol.cz. [90.178.123.150]) by smtp.gmail.com with ESMTPSA id j9sm6424949wrc.78.2018.01.25.17.36.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jan 2018 17:36:43 -0800 (PST) Subject: Re: [PATCH] Logical decoding of TRUNCATE To: Robert Haas Cc: Marco Nenciarini , Simon Riggs , PostgreSQL-development References: <269bf0d2-6ac4-c032-6979-22aad6a9f5fb@2ndquadrant.it> <20171229195536.cdzmgllfkln6wo6t@alap3.anarazel.de> <35a1d60b-f66d-4001-499b-2336ca81fc6c@2ndquadrant.it> <1a4ace10-1997-6644-d17a-5a17bf250270@2ndquadrant.it> <28a59551-b1f5-8ed4-65cf-76d17e7ee7e6@2ndquadrant.it> From: Petr Jelinek Message-ID: <5c6ede4a-1d58-fbdf-1faf-af024527a579@2ndquadrant.com> Date: Fri, 26 Jan 2018 02:36:42 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 26/01/18 02:34, Robert Haas wrote: > On Wed, Jan 17, 2018 at 12:07 PM, Petr Jelinek > 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