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 1nmSrE-0008QT-CI for pgsql-hackers@arkaria.postgresql.org; Thu, 05 May 2022 04:12:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nmSrD-00022h-45 for pgsql-hackers@arkaria.postgresql.org; Thu, 05 May 2022 04:12:51 +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 1nmSrC-00022X-R2 for pgsql-hackers@lists.postgresql.org; Thu, 05 May 2022 04:12:50 +0000 Received: from mail-yb1-xb31.google.com ([2607:f8b0:4864:20::b31]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nmSr6-0002wC-Kz for pgsql-hackers@lists.postgresql.org; Thu, 05 May 2022 04:12:49 +0000 Received: by mail-yb1-xb31.google.com with SMTP id v59so5675607ybi.12 for ; Wed, 04 May 2022 21:12:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=R1UEmQIysQeydTR2V1axk/V1Kn85ozm997i0OyNexTA=; b=kZ/RAAE/cLVxvUK59ajchA0v2YltTHLNW7G9OINGvoUxcGyc1mAJ0WTmiUfRUY7Rjc Pr3MJWmJ5hAu/q8cgu0h39Qa6OtiHVTYi6vQl2WXa/X4d/3GT9U73ZNBBXE0BPhsKKeV IZ2NZortN6k4MphkaDFJ1s4uDblh+XC/PygRQUZblL9O7BLa/QQG2aGe42w494R3lcvA xtE9mOoZxH7Fm5DyIo4rMsF4HvbOlmXyiw72+Ub3z/P5yo8uRpQ1cHM0+tbJTAELLDGR CFwfv4vf6yTLMlRCAz4NOukZfBZoFqEJdU4wooYqnVEcQO5BG4UHE4bllDqbu6VUm6vD edQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=R1UEmQIysQeydTR2V1axk/V1Kn85ozm997i0OyNexTA=; b=GGAIrBRXqHzVAWhpdKCwhf0MFuvtPmf+uI51r7jzJHAGq+AArs0my/wA+xw1ZuBL8Q UbmncLH5GhFWcx5/ibB4sTXHu/gxVf7As8MUCD52NXoZ0S5fjc8+irq4CRV/ZT10d4Nf 1TEuziWld3vig2OUMb1nOs/jssj/CWytnn9bUTf0jvOVVNULyobOH5s21ZDlpMeWvh9z zEZEiJb1hLtOcZl3qy6T8nWZe2WKTti71hBjZLDeTW/9pkoNjdUvw/bbHD0vp0VoQsfV ZVr4CNfAr0SSlLh+KbkR6IsWomHVPonpx6hhfExYHjG6D7f3pBhdhRw2DzyEy5hYaylB pupQ== X-Gm-Message-State: AOAM532QB1EefUlgP42h9nfGN0zU244BWodL4lpNlYUalWlPl0fRLrLd yzn4CYokQYz+tjy+DaI3Xn/DrrDhWPdtN2oRoyA= X-Google-Smtp-Source: ABdhPJzUtyzCXFlVe8ls5U62oDjpOw4myrI4IFyI4/yMrAFO0nOG4GbUNbjuekl8kF+B0eefoI+VuoPlC3+V/Zc+PvM= X-Received: by 2002:a25:5d0c:0:b0:641:e86:1314 with SMTP id r12-20020a255d0c000000b006410e861314mr20252995ybb.317.1651723963834; Wed, 04 May 2022 21:12:43 -0700 (PDT) MIME-Version: 1.0 References: <4f4867da-f581-0330-974f-da9031ac3e1c@enterprisedb.com> In-Reply-To: From: Amit Kapila Date: Thu, 5 May 2022 09:42:32 +0530 Message-ID: Subject: Re: Skipping schema changes in publication To: Peter Eisentraut Cc: vignesh C , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, May 5, 2022 at 9:20 AM Amit Kapila wrote: > > On Wed, May 4, 2022 at 7:05 PM Peter Eisentraut > wrote: > > > > On 14.04.22 15:47, Peter Eisentraut wrote: > > > That said, I'm not sure this feature is worth the trouble. If this is > > > useful, what about "whole database except these schemas"? What about > > > "create this database from this template except these schemas". This > > > could get out of hand. I think we should encourage users to group their > > > object the way they want and not offer these complicated negative > > > selection mechanisms. > > > > Another problem in general with this "all except these" way of > > specifying things is that you need to track negative dependencies. > > > > For example, assume you can't add a table to a publication unless it has > > a replica identity. Now, if you have a publication p1 that says > > includes "all tables except t1", you now have to check p1 whenever a new > > table is created, even though the new table has no direct dependency > > link with p1. So in more general cases, you would have to check all > > existing objects to see whether their specification is in conflict with > > the new object being created. > > > > Yes, I think we should avoid adding such negative dependencies. We > have carefully avoided such dependencies during row filter, column > list work where we don't try to perform DDL time verification. > However, it is not clear to me how this proposal is related to this > example or in general about tracking negative dependencies? > I mean to say that even if we have such a restriction, it would apply to "for all tables" or other publications as well. In your example, consider one wants to Alter a table and remove its replica identity, we have to check whether the table is part of any publication similar to what we are doing for relation persistence in ATPrepChangePersistence. > AFAIR, we > currently have such a check while changing persistence of logged table > (logged to unlogged, see ATPrepChangePersistence) where we cannot > allow changing persistence if that relation is part of some > publication. But as per my understanding, this feature shouldn't add > any such new dependencies. I agree that we have to ensure that > existing checks shouldn't break due to this feature. > > > Now publications don't actually work that way, so it's not a real > > problem right now, but similar things could work like that. So I think > > it's worth thinking this through a bit. > > > > This is a good point and I agree that we should be careful to not add > some new negative dependencies unless it is really required but I > can't see how this proposal will make it more prone to such checks. > -- With Regards, Amit Kapila.