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 1neALN-0005ZI-Pr for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Apr 2022 06:49:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1neALM-00055p-Ka for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Apr 2022 06:49:40 +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 1neALM-00055g-BQ for pgsql-hackers@lists.postgresql.org; Tue, 12 Apr 2022 06:49:40 +0000 Received: from mail-yw1-x1135.google.com ([2607:f8b0:4864:20::1135]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1neALG-0001q6-3M for pgsql-hackers@lists.postgresql.org; Tue, 12 Apr 2022 06:49:39 +0000 Received: by mail-yw1-x1135.google.com with SMTP id 00721157ae682-2ebf3746f87so95952157b3.6 for ; Mon, 11 Apr 2022 23:49:34 -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=n/Mp1gWrDVsf7NAVDGiRlj+WkZ0sm4sTCQOoniU1pWg=; b=cuuSnKYOr/ShEwRSY1nq8/eMveWV0SzJwKM4fUBkEDzTOH3RXafkWW/5qyxZVbEfOu eUNRGfbOThLAOkvZ/bR+fqjgX7DDJL2iEGNg+LfDfI9Bq8r+XauGAurfsOeGu08a/JmQ ckvU34j6UKDDWiQDR5rkFW0iFRBP8/TA4irlt6FU0Xqg+7tVe8+ykTw+07SsqQWDf2Lv QwyvJfFp4VEaZQ9DRQVMpm5oWYTu0i58cttVGm8Ky1c7YmBtP4ITHB8/8Hc3p6FOrKbk 9KGkwb25glyOgfSp0I5xQXm8Kef4Lzp9YejPlWfM0jTX81tiBRk6YJw8St565QzFUI8j LwhQ== 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=n/Mp1gWrDVsf7NAVDGiRlj+WkZ0sm4sTCQOoniU1pWg=; b=I6JXmhiUJOLbF+Uc1NjO6AnYZJcZm70SmFzKmLBvXOZxYucyhTNT4d7zgpe9ZGYJsH ZgOG5OP2gnUcXZMsk6gDuGmS9WEONOy//a6IRGgkpZtMY9tIFJmoytcQbUHse12qtq8Q GcR8K8XGouW/sZAWPIkKzDz5gAXk3aar+KD2eUZGULrSbi6F0TSA6ExzfhYl8ogeg+3Q yL0W1/CaIkBTmDZpDoMne6cm2QiolwAjC2cJIWIjODUv3d7UcADhHfcFlRHdS2/W1AY2 mRgnxGV/KG/QyQ3kAssOJlWXL3c8wL5FEaUJm1zxmb+QN2h49yrw7yNq7vF7WTo8kfP1 CeWA== X-Gm-Message-State: AOAM531fpTsAn+q2YU1j4FpuT7S8P/ZuUe8380VWKSW2oR44eLU5Ph6+ r8OEfkoD859Bib7GpkHJva8o7HADwk4jHUUD/qY= X-Google-Smtp-Source: ABdhPJzr55M6bVbjLy1JD7DuJNWUl2iHBioffGX6X473k2chWEJqLiBMLbV6slEzJoqdjlltqk43Gvd4VaQedSTiFKo= X-Received: by 2002:a81:89:0:b0:2eb:f118:291b with SMTP id 131-20020a810089000000b002ebf118291bmr13907806ywa.84.1649746173210; Mon, 11 Apr 2022 23:49:33 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Amit Kapila Date: Tue, 12 Apr 2022 12:19:22 +0530 Message-ID: Subject: Re: Skipping schema changes in publication To: vignesh C 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 Tue, Apr 12, 2022 at 11:53 AM vignesh C wrote: > > On Sat, Mar 26, 2022 at 7:37 PM vignesh C wrote: > > > > On Tue, Mar 22, 2022 at 12:38 PM vignesh C wrote: > > > > > > Hi, > > > > > > This feature adds an option to skip changes of all tables in specified > > > schema while creating publication. > > > 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 > > > schemas. > > > Ex: > > > CREATE PUBLICATION pub1 FOR ALL TABLES SKIP ALL TABLES IN SCHEMA s1,s2; > > > OR > > > ALTER PUBLICATION pub1 ADD SKIP ALL TABLES IN SCHEMA s1,s2; > > > > > > A new column pnskip is added to table "pg_publication_namespace", to > > > maintain the schemas that the user wants to skip publishing through > > > the publication. Modified the output plugin (pgoutput) to skip > > > publishing the changes if the relation is part of skip schema > > > publication. > > > As a continuation to this, I will work on implementing skipping tables > > > from all tables in schema and skipping tables from all tables > > > publication. > > > > > > Attached patch has the implementation for this. > > > > The patch was not applying on top of HEAD because of the recent > > commits, attached patch is rebased on top of HEAD. > > The patch does not apply on top of HEAD because of the recent commit, > attached patch is rebased on top of HEAD. > > 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; > For the second syntax (Alter Publication ...), isn't it better to avoid using ADD? It looks odd to me because we are not adding anything in publication with this sytax. -- With Regards, Amit Kapila.