Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ee2jC-0004tS-6X for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Jan 2018 17:51:22 +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 1ee2jB-0001Gg-OO for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Jan 2018 17:51:21 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ee2jB-0001GW-Dt for pgsql-hackers@lists.postgresql.org; Tue, 23 Jan 2018 17:51:21 +0000 Received: from mail-wr0-f175.google.com ([209.85.128.175]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ee2j8-0002kX-Jx for pgsql-hackers@postgresql.org; Tue, 23 Jan 2018 17:51:20 +0000 Received: by mail-wr0-f175.google.com with SMTP id g21so1463340wrb.13 for ; Tue, 23 Jan 2018 09:51:18 -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=aOk5OsHLCS3UJEoxkV4DwiiXADkuFaOtvBjrP4Z+ELM=; b=m7dU+u3RCRLRofIciph4cECUEGQGynuwoS47DdhAQsBbTYrmUatXhKmLmy7ywYgjTV i+u6n8P4c8KAuZWKXViVwO6sWzydjJczZvjWQYEcE8fBoNiR7VzD5y1PRhDU8epLkefE pJADYvJDz+OM0kas+nmHt+ZY6TmvPhVyJOt/raLj8cFzXFRA+pq9jtZ+j2iY0sWVFVhK GBidgXamoIwyiMP6/ZWsfZK+rNtGCqqBypKZYgfdCQDaK9FtajhFjFoPxKXrE8Q9XZNP ryOVaABxgr85zQmSB3hhsyTLGMTydJB+/zKVmNVXb9MgwEbLjZ9z5NSZm0YlKeQJGXet kxPQ== 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=aOk5OsHLCS3UJEoxkV4DwiiXADkuFaOtvBjrP4Z+ELM=; b=nTflI6j5FmfjrbOOVzWjZko7C58DoSRWYkCGa1bqqEl4Q6Mj3tLT31fp61OsEM4j1q IP1Y+5tCh2T/AvMCLZnXnh+DRmkKWJOr6zHgI12RYNn0Y21CZf3CgyGXMof0tscCs/g1 9K+Q6yPOKsQl/pZj0FbP0Ib53RSICCjjo97XQOsr+2qlJ4v59hz8Mt7+ZCloddBM9LM5 moSWctl27eb1P65N+xvzc91USTX2DSFMDmAhAPwF5SfMhhkH9cG8UP/ISt9vRUr7FPdF yo7fZnBQFPGw9TJ4UplglvcuVqGe/sVKZv30atl8YayJPNhluY8k791ii9PKy9hQFA64 +q6Q== X-Gm-Message-State: AKwxytf+RzIOyeNB5Y0mNMff/5i9BXXEycxQJxNqcgn35JOGJN2QCD44 i0mE775WrQjTV0VNDd/Z3eqo2hrqPT4ZWZPIAvNI6cyBxpzLA78N8drH0MefA6+JS04ctBMXYfa MQVkDwY9ahvS9VXTOgXHzmxElNVqF9NT7KHAf+nQGkTSbunrGx8UL4GwK06nmCDsxCasf0ZmZRq SefMWmG0qNEr4= X-Google-Smtp-Source: AH8x224Wq0qUwVPs42Ii7VwbSsah9SBjXXNubuH3Ug1Roo5UTcYc4m7O8CsWVmvtHpMKafRmxUFIew== X-Received: by 10.223.176.39 with SMTP id f36mr2863792wra.113.1516729816497; Tue, 23 Jan 2018 09:50:16 -0800 (PST) Received: from [192.168.0.106] (150.123.broadband11.iol.cz. [90.178.123.150]) by smtp.gmail.com with ESMTPSA id 62sm687982wml.24.2018.01.23.09.50.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Jan 2018 09:50:15 -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> <31773cc5-3b29-1740-e7d2-dc48e80a06ce@2ndquadrant.com> From: Petr Jelinek Message-ID: <35df4fd5-6b74-9c15-9246-ead8854cc669@2ndquadrant.com> Date: Tue, 23 Jan 2018 18:50:15 +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 Hi, On 23/01/18 18:47, Marco Nenciarini wrote: > Il 23/01/18 18:25, Petr Jelinek ha scritto: >> 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. >> > > Ok, Removed. > Great, thanks, I think this is ready now so marking as such. -- Petr Jelinek http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services