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 1nhvqt-00056H-Mp for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Apr 2022 16:09:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nhvqq-0005s6-Kd for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Apr 2022 16:09:44 +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 1nhvqq-0005rx-3S for pgsql-hackers@lists.postgresql.org; Fri, 22 Apr 2022 16:09:44 +0000 Received: from mail-oa1-x32.google.com ([2001:4860:4864:20::32]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nhvqj-0007q1-I2 for pgsql-hackers@lists.postgresql.org; Fri, 22 Apr 2022 16:09:42 +0000 Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-e2afb80550so9105851fac.1 for ; Fri, 22 Apr 2022 09:09:37 -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=TkD3qhqqE/RklOWA/b44SNL6nW8Ruk803dnyH905G/g=; b=IIX3Za6X8mPQUkcpJOheN5yxU/HFPHTP4480uWtZAIs7f68iZrr7VEA5f9XhT4GJX8 eHVxRS/Df1bpCL6QsjXw7nCCwZEL24+AnUFWRQO5fkTNok4F1FaPATHnENJqMr2m6VpT x+4P9G6NrGLuk7FUBVlHjpwOy03Y3kg8GhsCwKxiSCK//qKC3BovqAM2hZOpyBS1koxN jU+zxOnHs1CUqAlRFo4ePTWwWXbaZHiBlGA9/QQmGB+2Ik9D7BCbp2V8C8LPezrC21Tm 6Zh7rVw3QIINtF4IdAuc6qVAlOtaOvhYHttZANo0EJlQnNNJA9mhITJ/n/RJ+HmZTJ68 hDTw== 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=TkD3qhqqE/RklOWA/b44SNL6nW8Ruk803dnyH905G/g=; b=bW0u8LWMkafZFl7dG8Zij8eqasSwijYzZ8R9tZElYzE+EQqAsTRgbhu0FNphIestQ6 ehT5ORAb4aR5asZwV0SHNNmTIDyvbPjP+q/2H9HM6LSNS7E5hl6w27PeCNmWxLBIKBcj IEMru5QuFBweTG4zB9haHz6cBSZSIxjlb2sUxMk41FC36lGifikeGrJ/Ryh1u29kcLC5 kJipqtl0fjCyCVcFGNgzkt1CFjbAH/6TX20rs4BwwDBVqgNyfLb8x8vmcha9j6zJuHxp f3vm4rgKGZxcwTG8tFj2by0gf0YtgDIK6eDjWZrd7o0P29RT6bdKo/ID4d10I8K6lXZg ABfg== X-Gm-Message-State: AOAM533oKU0Zsvw4WeHA4E/C3PbqDse0xiz/1fZDW+KR3mhZur/zOdHO pYLFYfhsten+JSqSKA+ZL/+Kmb8ha8l5njXIxzI= X-Google-Smtp-Source: ABdhPJxeItJE17ithCmDJOtLeKaum8rk/Bj74UcTpKlWWbicxQktkIovrbAXSt5/aLEH1RKuZusNFqzCL+VI9fJANcI= X-Received: by 2002:a05:6870:80c7:b0:e6:82aa:afd5 with SMTP id r7-20020a05687080c700b000e682aaafd5mr2206337oab.157.1650643776578; Fri, 22 Apr 2022 09:09:36 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bharath Rupireddy Date: Fri, 22 Apr 2022 21:39:24 +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, Mar 22, 2022 at 12:39 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. > This feature is for the pg16 version. > Thoughts? The feature seems to be useful especially when there are lots of schemas in a database. However, I don't quite like the syntax. Do we have 'SKIP' identifier in any of the SQL statements in SQL standard? Can we think of adding skip_schema_list as an option, something like below? CREATE PUBLICATION foo FOR ALL TABLES (skip_schema_list = 's1, s2'); ALTER PUBLICATION foo SET (skip_schema_list = 's1, s2'); - to set ALTER PUBLICATION foo SET (skip_schema_list = ''); - to reset Regards, Bharath Rupireddy.