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 1ngNsV-0007SU-Pf for pgsql-hackers@arkaria.postgresql.org; Mon, 18 Apr 2022 09:41:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ngNsU-0007Z4-B9 for pgsql-hackers@arkaria.postgresql.org; Mon, 18 Apr 2022 09:41:02 +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 1ngNsT-0007Yv-Vk for pgsql-hackers@lists.postgresql.org; Mon, 18 Apr 2022 09:41:02 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ngNsR-00030m-EI for pgsql-hackers@lists.postgresql.org; Mon, 18 Apr 2022 09:41:00 +0000 Received: by mail-ej1-x62c.google.com with SMTP id ck12so4383871ejb.4 for ; Mon, 18 Apr 2022 02:40:59 -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=B9EAX1zoLSo420tKf4PtTVaiMWK4e8ogdGYfnFJGE+4=; b=hhvdE0YN1EGxK5UQ+wKyoufymqWDPjYmPyTqRtSjkZ9q67T1duD+DGKqEhUBFiSj3b rC3HMXu3oxNXN5vH2hwcXCkS7vu44Wdg2t2GSJqOA4Q1EP29LwV8NlbgULXHr6+gTyNC 0XKJ08lqiPw/+wBOBBukrGsadr1sbdXfN6OGuSBoH7BS4JHeoePiGnF/RrxibmpV0kCQ N3BA0VQRLhkRwaimHSlrl6NG+gJ5fYzXA/7p8CJNjTdZdDXjIvsrxh94Pg28JPIVI2T2 cnixzDYIP0m8btsNdEcsCg1361WfQDzIrRVnAYdUd0v5JBqYvNy4sqAs72XVspNDcuoo uN9g== 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=B9EAX1zoLSo420tKf4PtTVaiMWK4e8ogdGYfnFJGE+4=; b=LE2s+ecGxWpCB7RLDBuJJ7oBhM5y5ETwnAmlct9Fl0u1Rx84gjWzFcR1vT7wagQ7jq pUJ2amC++0cUZMb7easNqEPi5i49sl2JDAupkIL7DoFe4mTwrhjCw/ID8UZSyQ3GOlxj erajwLXjZYOgNByfp+CO7K7OTXVQqSiMgUzpqwNsG1bxta0z3DUBI6A4qe/WlHPigP+R rJvam0k7I/qwm77idNygue/ax75BCmuZkRzIw0EUlSQlL1rLcw3Wdz5NYLUiRvQTPjaQ YoPeEw6s1W2SRUxO9V7arOPvcUIhU/znv5k7oMbQq1he+yEdYPoThNoj1aydNAfRyuE9 ETHw== X-Gm-Message-State: AOAM530G6P1pBOoB8Q0/mTKxg/gkFJi9MuJdTJzn9/FM9AeVHS3eFnrC USClFE6+Qkg81cn8d0iPLJAp8z0XvqTCKbBVeCm032L+sQY= X-Google-Smtp-Source: ABdhPJxM35LqI9a4AB6FKjcJt0aEbIK2uY/RHmSgaaVdajTkMMAtUlrbHRhlaKGz7/I6NwEVQmWhcYPhox7pNyCxvFI= X-Received: by 2002:a17:907:7206:b0:6ef:b47c:e5ec with SMTP id dr6-20020a170907720600b006efb47ce5ecmr3027910ejc.351.1650274857610; Mon, 18 Apr 2022 02:40:57 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: vignesh C Date: Mon, 18 Apr 2022 15:10:46 +0530 Message-ID: Subject: Re: Skipping schema changes in publication To: Peter Eisentraut Cc: 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, Apr 14, 2022 at 7:18 PM Peter Eisentraut wrote: > > On 12.04.22 08:23, vignesh C wrote: > > I have also included the implementation for skipping a few tables from > > all tables publication, the 0002 patch has the implementation for the > > same. > > This feature is helpful for use cases where the user wants to > > subscribe to all the changes except for the changes present in a few > > tables. > > Ex: > > CREATE PUBLICATION pub1 FOR ALL TABLES SKIP TABLE t1,t2; > > OR > > ALTER PUBLICATION pub1 ADD SKIP TABLE t1,t2; > > We have already allocated the "skip" terminology for skipping > transactions, which is a dynamic run-time action. We are also using the > term "skip" elsewhere to skip locked rows, which is similarly a run-time > action. I think it would be confusing to use the term SKIP for DDL > construction. > > Let's find another term like "omit", "except", etc. +1 for Except > I would also think about this in broader terms. For example, sometimes > people want features like "all columns except these" in certain places. > The syntax for those things should be similar. > > 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. I thought this feature would help when there are many many tables in the database and the user wants only certain confidential tables like credit card information. In this case instead of specifying the whole table list it will be better to specify "ALL TABLES EXCEPT cred_info_tbl". I had seen that mysql also has a similar option replicate-ignore-table to ignore the changes on specific tables as mentioned in [1]. Similar use case exists in pg_dump too. pg_dump has an option exclude-table that will be used for not dumping any tables that are matching the table specified as in [2]. [1] - https://dev.mysql.com/doc/refman/5.7/en/change-replication-filter.html [2] - https://www.postgresql.org/docs/devel/app-pgdump.html Regards, Vignesh