Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ee2Js-0002XF-JF for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Jan 2018 17:25:12 +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 1ee2Js-0000l6-0L for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Jan 2018 17:25: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 1ee2Jr-0000kd-PF for pgsql-hackers@lists.postgresql.org; Tue, 23 Jan 2018 17:25:11 +0000 Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ee2Jo-0005rj-Lg for pgsql-hackers@postgresql.org; Tue, 23 Jan 2018 17:25:11 +0000 Received: by mail-wm0-x22b.google.com with SMTP id j21so14396777wmh.1 for ; Tue, 23 Jan 2018 09:25:08 -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=+rCzuMUaN+nEguP34r7Nodlma++lIq6+axjEh8v+0bQ=; b=hrj136Oba20emdyIOFknzcR+GWccl3NuR12vv9xwGxkDWXfSF9In/rPcIMdqGrMAk4 Z92o4JC0PCttykp4OTXKSxWQrO/3b6IIfeuRZQtq2gXs8S0yICMkxS5JivrkwulLo637 MiatVvlS667YMVUPulFh/Z74TEX7+4GGjgOCbx2b250Y95HGI/wDyBv1jefIJFUKlaSX ijei+JgArBAo3qdlfOzPbxLIMnSDQcCVV8CRk9G+qOnkYGEN5UNMi8rW0jbA55EdYLe1 fSXf5iYk3guNKcG/KzEJI1XRkNOVDckTm9/2TuNuu+VnY8buFHVZn79vB8ZPJesJOGDX mQbg== 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=+rCzuMUaN+nEguP34r7Nodlma++lIq6+axjEh8v+0bQ=; b=Nid6I4VI9zMXe5UFOg0sVCM8TuQPVE+br8a8F+pcrVYpbXK7UDBVFE6YnxtDZcB1xn ZGAmd1UDDFd4/xficQsIlU0tX1jKFbnOY3+VnB3b4aWY0xFQZ8XKuoo+PxQZSPfFOplQ uM/GiOAr48/g7owU/5nwOfsoEhrBwCm1p6mpXf0F52beqU0rWFw0LT2GowEFdmfMkwfo yDhL820GL9dSqyv31P8ZPPcfIN0MJv7yQLR+K7j40xe2IBwm3xSak/Eh9vk5KkIxdZmU PpfaswkufJOAkfw6GlOIwWf+nGNzn8bukmR2XUX1aAxRpm4HgEImgSx7djZTOZwyI/gc rs8w== X-Gm-Message-State: AKwxytewkGsXFsZomwcnw84XSiiMSUU+g27khCTFro9o26Plb3jZ4+wy lbT5wh/0KV1YqyG2rBWkN4zpdfnBqa4pLNb9UE6qiXfrQddovcmVjU4szwHHvSwf9VA9Zg/sSCV X3RxKjW3l76WDPMP+rXVWu1hFUaGNFnbLo3/D3y74U/A2z/QC26I7Gx+z5AySnzvD3U3hnEvoIF qt1JGr1DHRkoQ= X-Google-Smtp-Source: AH8x225j0lL1KzYzU2SBXcLMk4cjh0Ae9SILxCYBoDyyi/+9vBueBjebLguxotX7o3dbGdAnBgXuvQ== X-Received: by 10.28.192.24 with SMTP id q24mr2661557wmf.96.1516728307252; Tue, 23 Jan 2018 09:25:07 -0800 (PST) Received: from [192.168.0.106] (150.123.broadband11.iol.cz. [90.178.123.150]) by smtp.gmail.com with ESMTPSA id m45sm1109850wrf.75.2018.01.23.09.25.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Jan 2018 09:25:06 -0800 (PST) Subject: Re: [PATCH] Logical decoding of TRUNCATE To: Marco Nenciarini , Simon Riggs Cc: 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> <1cb9bd52-9e3a-21bf-0c0c-afa90f463629@2ndquadrant.com> <0361327b-5d59-32b0-cb13-e844acf0f0d0@2ndquadrant.it> From: Petr Jelinek Message-ID: <31773cc5-3b29-1740-e7d2-dc48e80a06ce@2ndquadrant.com> Date: Tue, 23 Jan 2018 18:25:05 +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: <0361327b-5d59-32b0-cb13-e844acf0f0d0@2ndquadrant.it> 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 23/01/18 18:19, Marco Nenciarini wrote: > Il 23/01/18 18:13, Petr Jelinek ha scritto: >> Hi, >> >> On 23/01/18 15:38, Marco Nenciarini wrote: >>> Il 22/01/18 23:18, Petr Jelinek ha scritto: >>>> On 22/01/18 19:45, Petr Jelinek wrote: >>>> >>>> Actually on second look, I don't like the new boolean parameter much. >>>> I'd rather we didn't touch the input list and always close only >>>> relations opened inside the ExecuteTruncateGuts(). >>>> >>>> It may mean more list(s) but the current interface is still not clean. >>>> >>> >>> Now ExecuteTruncateGuts unconditionally closes the relations that it >>> opens. The caller has now always the responsibility to close the >>> relations passed with the explicit_rels list. >> >> This looks good. >> >>> >>> Version 15 attached. >>> >> >> I see you still do CASCADE on the subscriber though. >> > > No it doesn't. The following code in worker.c prevents that. > > > + /* > + * Even if we used CASCADE on the upstream master we explicitly > + * default to replaying changes without further cascading. > + * This might be later changeable with a user specified option. > + */ > + cascade = false; Ah, that's pretty ugly, why don't we just use DROP_RESTRICT always instead of this (keeping the comment). Unless you plan to make it option as part of this patch, the current coding is confusing. -- Petr Jelinek http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services