Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pdJd7-00040c-6F for pgsql-hackers@arkaria.postgresql.org; Fri, 17 Mar 2023 23:37:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pdJd5-0004vE-1Z for pgsql-hackers@arkaria.postgresql.org; Fri, 17 Mar 2023 23:36:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pdJd4-0004uz-MY for pgsql-hackers@lists.postgresql.org; Fri, 17 Mar 2023 23:36:58 +0000 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pdJd1-0003eK-Ou for pgsql-hackers@lists.postgresql.org; Fri, 17 Mar 2023 23:36:57 +0000 Received: by mail-pj1-x102b.google.com with SMTP id x11so5023249pja.5 for ; Fri, 17 Mar 2023 16:36:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=timescale.com; s=google; t=1679096214; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=85rm8WLhjnUns34kVNyCtn6T9MLtYmAcI0SKMJaZcso=; b=Gc+EXCPIKY1M8UCeRIJLwU3uCw9JOQoo1ZhMzFkgRH40JMd34almX099aYIm1TDtiB Rq+bLDphgmVDhgKQeFkV+3CO5hgaYMJdP0s/OK6vBGGoz4hmUhbR4xxQfvBT3S61+bPK PVlKKRyVsm7JUd9k3y41hCTJTUWQe3BCXGo5KptJ+zJ1A1QMtsGlebIFyWwcCfYPNaui tjxIO7xRlEF9XkN7rWfu39KQmwmomBTTIl9WH/m2JsPHB6I77EJ7zzV9/ycofxRENM9V VoFtOzLIDFiJNU+s2cx02dXLKokUvRxoZFIKnXhbMYQByyvKoBpeqw/KmQA2gMB8DE+a rdjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679096214; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=85rm8WLhjnUns34kVNyCtn6T9MLtYmAcI0SKMJaZcso=; b=rN7yTIngmZckHoAAKxqqJ22MhjMhm7TnFVRY2bAoxk7eVOEIt96axnekHqF2QqMcWD 5212HZlGSV417N28vYcduwknz4K8T4ku21sp2OQ7BDNA108uijaWboGerHqB6bIUsBO4 Mafkiu1TaJw099nhBXAUrVvqgDxDcW64WEsAZmNU2wRH4jQ+d/IJnTulHbG5VZPvuR02 5WLTAi5klt3BVRJ7fenqX1hPPNwHt6mgLtAgR2T76MOtOrTJ+qtteyuR7HDWkoZSOlfl VkShzDohy2954/g8njAPNDY+z+gsAtno2GMvNMXRBAkVIMI5RW8le3I6FvFvacj8MYIj qI3w== X-Gm-Message-State: AO0yUKXeDyevYZecNulnhMGIXcDeY78k+ek56LPUl4/mETpIQ/ZkPC++ 8dp8oX9dBayIdvbHucnAukokEg== X-Google-Smtp-Source: AK7set/U9HTAChlxTnLhHVyEXLnAqsLDjdgUSyjS39JgDHicAEvdlN0/++E0oKo8ItCUY9sNZ9onhg== X-Received: by 2002:a05:6a20:938b:b0:be:a177:af42 with SMTP id x11-20020a056a20938b00b000bea177af42mr12112225pzh.62.1679096214388; Fri, 17 Mar 2023 16:36:54 -0700 (PDT) Received: from [192.168.1.21] ([50.53.8.205]) by smtp.gmail.com with ESMTPSA id n21-20020a62e515000000b0058bc60dd98dsm2074434pff.23.2023.03.17.16.36.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 17 Mar 2023 16:36:54 -0700 (PDT) Message-ID: Date: Fri, 17 Mar 2023 16:36:53 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 From: Jacob Champion Subject: Re: Data is copied twice when specifying both child and parent table in publication To: "wangw.fnst@fujitsu.com" Cc: Amit Kapila , Andres Freund , vignesh C , Peter Smith , "Takamichi Osumi (Fujitsu)" , "shiy.fnst@fujitsu.com" , "houzj.fnst@fujitsu.com" , Amit Langote , Peter Eisentraut , "pgsql-hackers@lists.postgresql.org" , Dilip Kumar , Greg Nancarrow References: <20230207202834.c2ptvco7dv57t3hi@awork3.anarazel.de> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Mar 16, 2023 at 11:28 PM wangw.fnst@fujitsu.com wrote: > Attach the new patch set. Hi, I ran into this problem while hacking on [1], so thank you for tackling it! I have no strong opinions on the implementation itself; I just want to register a concern that the tests have not kept up with the implementation complexity. For example, the corner case mentioned in 0003, with multiple publications having conflicting pubviaroot settings, isn't tested as far as I can see. (I checked manually, and it appears to work as intended.) And the related pub_lower_level test currently only covers the case where multiple publications have pubviaroot=true, so the following test comment is now misleading: > # for tab4, we publish changes through the "middle" partitioned table > $node_publisher->safe_psql('postgres', > "CREATE PUBLICATION pub_lower_level FOR TABLE tab4_1 WITH (publish_via_partition_root = true)" > ); ...since the changes are now in fact published via the tab4 root after this patchset is applied. > I think the aim of joining it with pg_publication before is to exclude > non-existing publications. Otherwise, we would get an error because of the call > to function GetPublicationByName (with 'missing_ok = false') in function > pg_get_publication_tables. In the same vein, I don't think that case is covered anywhere. There are a bunch of moving parts and hidden subtleties here, and I fell into a few traps when I was working on my patch, so it'd be nice to have additional coverage. I'm happy to contribute effort in that area if it's helpful. Thanks! --Jacob [1] https://postgr.es/m/dc57f088-039b-7a71-8f4c-082ef106246e%40timescale.com