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 1nytU5-0001e2-Nd for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jun 2022 11:04:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nytU4-000172-IW for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jun 2022 11:04:20 +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 1nytU4-00015c-9P for pgsql-hackers@lists.postgresql.org; Wed, 08 Jun 2022 11:04:20 +0000 Received: from mail-yw1-x1132.google.com ([2607:f8b0:4864:20::1132]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nytU1-0003vb-Mr for pgsql-hackers@lists.postgresql.org; Wed, 08 Jun 2022 11:04:19 +0000 Received: by mail-yw1-x1132.google.com with SMTP id 00721157ae682-3137c877092so4858327b3.13 for ; Wed, 08 Jun 2022 04:04:17 -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=71/l/rH6Aqi+i0TpptC8JQRvSQCe5n8GojMi+vV+CP4=; b=GxEoLcO9lBjDVJgW0oIw+VRLgT2sZhURvOTuS5GJajzgxM5hPtwqG2SP0Vr36o5to8 WUaSwBC5498D2HYJiz4i6hHKx56pEjdzwuJZRqKtoae/HTSLcRiITfoO0tj1yCmA3HrI MLrVB0/MzfJgige0O63LMwJRauY7MML9WuTP0iirPzXsnxkNNAZS8wpUnilBuIxBZQRD LcykGHg/SO1uhT9gF/UMZzGgcQ1Pteqe01kRnV/raoOuqGdm6z6QR316tBTHkyyjS333 ZQipU2Lp9CeaLQteZiRzm7Ekaa8W5ebYrrkyrXeHXJOshXpLKmP1kmmEGw8TkH4/CG3y nXGQ== 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=71/l/rH6Aqi+i0TpptC8JQRvSQCe5n8GojMi+vV+CP4=; b=m5F5zdWow3cMPyTM0sgCuvK3Fnm3CzDV6OpFE4lI+Gt1iOjbz5briDIglUC0oxPVsO J6vy0G4RyiLSZmwvt7DYMYOKmoeq0VPawXc57xd8CcQud3zqZ0wR6KHOqfiK+OenAtHI S7VBVnU1cgXJMp6eeXXgIL6mnLD3HiqGDAOywy8wuWiicYCasBiclbAc74SERKMNExZq Yh1RqoxrbnUCZ2buHWD6x9aE3h1BrG/J56xuobRDTKyNu3fr1aUywno/w+phj40xaLA0 9B+Gu7C8WiX9kteX9aPd5OuHK9pjCTH0olOhXnm/rEM45S6zqukxQki0A2kcatbdToit IUlw== X-Gm-Message-State: AOAM532OWYJk7DOjwEsMGCiQ8FP6kB6r+OZdSLxAghzR/Mpsq183Yf5Z ZkBGIMEbtWOgt+HiOCw3yA3o93pioDz00F52OnI= X-Google-Smtp-Source: ABdhPJz8zrDlWPPYW64X7G4CS5SI+1R32gnGbR6nBQlVEdA89iMH+TsY0eSseM0KM8//P0I0vc6dgEkcUPf4feI80pg= X-Received: by 2002:a81:ad55:0:b0:30c:6a07:48 with SMTP id l21-20020a81ad55000000b0030c6a070048mr36874656ywk.84.1654686256767; Wed, 08 Jun 2022 04:04:16 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Amit Kapila Date: Wed, 8 Jun 2022 16:34:05 +0530 Message-ID: Subject: Re: Skipping schema changes in publication To: vignesh C Cc: "osumi.takamichi@fujitsu.com" , Peter Smith , Bharath Rupireddy , 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 Fri, Jun 3, 2022 at 3:37 PM vignesh C wrote: > > Thanks for the comments, the attached v8 patch has the changes for the same. > AFAICS, the summary of this proposal is that we want to support exclude of certain objects from publication with two kinds of variants. The first variant is to add support to exclude specific tables from ALL TABLES PUBLICATION. Without this feature, users need to manually add all tables for a database even when she wants to avoid only a handful of tables from the database say because they contain sensitive information or are not required. We have seen that other database like MySQL also provides similar feature [1] (See REPLICATE_WILD_IGNORE_TABLE). The proposed syntax for this is as follows: CREATE PUBLICATION pub1 FOR ALL TABLES EXCEPT TABLE t1,t2; or ALTER PUBLICATION pub1 ADD ALL TABLES EXCEPT TABLE t1,t2; This will allow us to publish all the tables in the current database except t1 and t2. Now, I see that pg_dump has a similar option provided by switch --exclude-table but that allows tables matching patterns which is not the case here. I am not sure if we need a similar variant here. Then users will be allowed to reset the publication by: ALTER PUBLICATION pub1 RESET; This will reset the publication to the default state which includes resetting the publication parameters, setting the ALL TABLES flag to false, and dropping the relations and schemas that are associated with the publication. I don't know if we want to go further with allowing to RESET specific parameters and if so which parameters and what would its syntax be? The second variant is to add support to exclude certain columns of a table while publishing a particular table. Currently, users need to list all required columns' names even if they don't want to hide most of the columns in the table (for example Create Publication pub For Table t1 (c1, c2)). Consider user doesn't want to publish the 'salary' or other sensitive information of executives/employees but would like to publish all other columns. I feel in such cases it will be a lot of work for the user especially when the table has many columns. I see that Oracle has a similar feature [2]. I think without this it will be difficult for users to use this feature in some cases. The patch for this is not proposed but I would imagine syntax for it to be something like "Create Publication pub For Table t1 Except (c3)" and similar variants for Alter Publication. Have I missed anything? Thoughts on the proposal/syntax would be appreciated? [1] - https://dev.mysql.com/doc/refman/5.7/en/change-replication-filter.html [2] - https://docs.oracle.com/en/cloud/paas/goldengate-cloud/gwuad/selecting-columns.html#GUID-9A851C8B-48F7-43DF-8D98-D086BE069E20 -- With Regards, Amit Kapila.