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 1nmSWv-0007gj-RL for pgsql-hackers@arkaria.postgresql.org; Thu, 05 May 2022 03:51:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nmSVw-0000no-FL for pgsql-hackers@arkaria.postgresql.org; Thu, 05 May 2022 03:50:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmSVw-0000nf-3y for pgsql-hackers@lists.postgresql.org; Thu, 05 May 2022 03:50:52 +0000 Received: from mail-yb1-xb2e.google.com ([2607:f8b0:4864:20::b2e]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nmSVt-0007oF-Mn for pgsql-hackers@lists.postgresql.org; Thu, 05 May 2022 03:50:51 +0000 Received: by mail-yb1-xb2e.google.com with SMTP id y76so5682292ybe.1 for ; Wed, 04 May 2022 20:50:49 -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=dYUQ2UARtuTRs7bHSe5TceXcbuUmIbBHw+VlRHb9Wfg=; b=Eefel4GDB+UzFggC7XDejxLrXPRAxvXtfCPvSFlDR201d9tsJC/aJy17a4Z49rhR9H YRWrE7zeqY0iTZA2IaPV4eTh767jj0D8R3oWE/ivG2CpB0noQtRXvCMKWwfbr50MQkq6 /FUcBK7G7nEoRrgutuiC44u0xCuaIPHdjBYu4/WNf0xbquZK7mb1CIHhs8GrJUplryw2 hYjGBVFUjKb/J+OFcTrw09PoYgbzrgU8TAT34141nB2mDK0G7C+iCQidTyjErFaP3qM5 X3ZnmYXBk2rdJTSMU94AZz3p7c15noDvXNPu2nDpGNQ55YNV9mULj4EXp9lTTeXmKFhL 1Epw== 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=dYUQ2UARtuTRs7bHSe5TceXcbuUmIbBHw+VlRHb9Wfg=; b=i+A4qsqvqaNISccUXfh7wuUscH31O0A+ORMoiaIz/9qsK1NgKm89S72F/98KS4Taev lEE79/uGwu2u2isABix49u9qXp7hllvOuk5jg7x8hUmIxX3cjjo057H+of50lPQ4VQzI o369J2W9wyL7fnE4bBwg3+7gcx49PFzrEEzp4LKt1taKfwnD5/tkTUDGbn98YOG9D9nQ FeUxGXIq0oGPvL+AMvXlHikBv0SGlWaz7LKwj3llV7MVOTKG1VFOTTrtuO2FL9ZOmjjn Ku/H2PvCK0xmgE/vBGHdTXmaAwHt+Wqz9zErtUMRELD6rK2g1vbkL0VyPfW/Kyo1+ydH WVcw== X-Gm-Message-State: AOAM530Af6QjT9nSwde9EFRQ030hOnGOoXAfCzCGBaAg1KBXNPByWeh6 GV5XxINwHLilqPLOPouTjUL5o+uYYNmv56qyKyY= X-Google-Smtp-Source: ABdhPJxdQfMR8D62GK7KC0oBh9Bm8EKIVyZ4OnINs4UPJKVqW+BmkHqwWT9YEuMWL15V0sQ1nKl3QB6lahLcxmU4FS0= X-Received: by 2002:a5b:f83:0:b0:63d:a251:2c51 with SMTP id q3-20020a5b0f83000000b0063da2512c51mr19270957ybh.594.1651722647848; Wed, 04 May 2022 20:50:47 -0700 (PDT) MIME-Version: 1.0 References: <4f4867da-f581-0330-974f-da9031ac3e1c@enterprisedb.com> In-Reply-To: <4f4867da-f581-0330-974f-da9031ac3e1c@enterprisedb.com> From: Amit Kapila Date: Thu, 5 May 2022 09:20:36 +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 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? 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.