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 1nrNlz-0006Fp-4f for pgsql-hackers@arkaria.postgresql.org; Wed, 18 May 2022 17:47: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 1nrNly-0007Y7-1U for pgsql-hackers@arkaria.postgresql.org; Wed, 18 May 2022 17:47:46 +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 1nrNlx-0007Xj-Ow for pgsql-hackers@lists.postgresql.org; Wed, 18 May 2022 17:47:45 +0000 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nrNlr-0005wJ-5c for pgsql-hackers@lists.postgresql.org; Wed, 18 May 2022 17:47:45 +0000 Received: by mail-ed1-x532.google.com with SMTP id i40so3959698eda.7 for ; Wed, 18 May 2022 10:47:39 -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=lz5fts4AHFStkNfcCGa+sxI1fn2yjYk0+XYp1H0jNQg=; b=peo/oo37cThSmYjA2556Ap39OfD8MG7Wcwr9pBA9ry2Sj7uQsrtzaY9XgGdkY+EywB jndesiEaXjIlvZDKy+OgzAPC89oIwusJm9dcB0r4ANIjjSdVnDx+6jiA3krohszmW7OA j7zJxyR1xxabwf0YvANd/25icV+TJPIpw5Ql6edS9SYOdRgR3QHkmWJYkMvA2Pocn+xr P7B8zhpUyHbIgPcLx9MVHx26mdDXOvDLye4dYglgJCrkJpjNv1GLxO8ecK5lVMghyEqW Josn3vfW1y/JUq7fykLv2sJpzwirU7AXtVG6iH7eBksmzQdQ1O0nJeGPaJe/qwS3xuVR ZP0A== 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=lz5fts4AHFStkNfcCGa+sxI1fn2yjYk0+XYp1H0jNQg=; b=H9Jk/b/nCEcIzUTedic8a8ygjxA/06uRYpmPWkn0Eto51PXpZLfJpXK+7D4WfTjTf4 YHJ1wTCA2saI8wGNaanPJnOZWFCwn6VSlUvdbQ2V2L/BZQPpFwtjsaxClq8zkM/VgSAh IeqJEv66cM3ChrrJ7n0AXlojEQBnDaQEf1C7TlDeoAXHJIfxk2sQ78lf/bKRsGCLsIWR ZRRakQaGMR8uh1U+0Lbe6mihdxdZc6yqEQYX+ZnrnIxrFB7UaPKZbRv5fR7Hsq8PkIpZ VIin4fdL4RzPn5WBVeVNXWyRMqID81HjdN+nxKDBtjDnoF4t5S09tV+ssWsRiqrJ+jaD +4pw== X-Gm-Message-State: AOAM530sgGVmERKcRbQJvjCdyVQXuHyZOHtmXbm/PsZWSAsRv05fuPYp KbrE5tTj6YMxwhyc1ydbLTOyWlV0T9xodHdsAASYTPIsnUM= X-Google-Smtp-Source: ABdhPJyqHthvD2CDK96COEDdngKJO6Swxi2eAjj8NWevPjJtiWE4IEgRrQMdPyiA9IRpexAk6d9WUdf8+YfWXnmdIjc= X-Received: by 2002:a05:6402:28b2:b0:42a:e63d:880f with SMTP id eg50-20020a05640228b200b0042ae63d880fmr948430edb.279.1652896058379; Wed, 18 May 2022 10:47:38 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: vignesh C Date: Wed, 18 May 2022 23:17:27 +0530 Message-ID: Subject: Re: Skipping schema changes in publication To: Peter Smith Cc: Amit Kapila , 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 Mon, May 16, 2022 at 2:53 PM Peter Smith wrote: > > Below are my review comments for v5-0001. > > There is some overlap with comments recently posted by Osumi-san [1]. > > (I also have review comments for v5-0002; will post them tomorrow) > > ====== > > 1. Commit message > > This patch adds a new RESET clause to ALTER PUBLICATION which will reset > the publication to default state which includes resetting the publication > options, setting ALL TABLES option to false and dropping the relations and > schemas that are associated with the publication. > > SUGGEST > "to default state" -> "to the default state" > "ALL TABLES option" -> "ALL TABLES flag" Modified > ~~~ > > 2. doc/src/sgml/ref/alter_publication.sgml > > + > + The RESET clause will reset the publication to the > + default state which includes resetting the publication options, setting > + ALL TABLES option to false and > + dropping all relations and schemas that are associated with the publication. > > > "ALL TABLES option" -> "ALL TABLES flag" Modified > ~~~ > > 3. doc/src/sgml/ref/alter_publication.sgml > > + invoking user to be a superuser. RESET of publication > + requires the invoking user to be a superuser. To alter the owner, you must > > SUGGESTION > To RESET a publication requires the invoking user > to be a superuser. I have combined it with the earlier sentence. > ~~~ > > 4. src/backend/commands/publicationcmds.c > > @@ -53,6 +53,13 @@ > #include "utils/syscache.h" > #include "utils/varlena.h" > > +#define PUB_ATION_INSERT_DEFAULT true > +#define PUB_ACTION_UPDATE_DEFAULT true > +#define PUB_ACTION_DELETE_DEFAULT true > +#define PUB_ACTION_TRUNCATE_DEFAULT true > +#define PUB_VIA_ROOT_DEFAULT false > +#define PUB_ALL_TABLES_DEFAULT false > > 4a. > Typo: "ATION" -> "ACTION" Modified > 4b. > I think these #defines deserve a 1 line comment. > e.g. > /* CREATE PUBLICATION default values for flags and options */ Added comment > 4c. > Since the "_DEFAULT" is a common part of all the names, maybe it is > tidier if it comes first. > e.g. > #define PUB_DEFAULT_ACTION_INSERT true > #define PUB_DEFAULT_ACTION_UPDATE true > #define PUB_DEFAULT_ACTION_DELETE true > #define PUB_DEFAULT_ACTION_TRUNCATE true > #define PUB_DEFAULT_VIA_ROOT false > #define PUB_DEFAULT_ALL_TABLES false Modified The v6 patch attached at [1] has the changes for the same. [1] - https://www.postgresql.org/message-id/CALDaNm0iZZDB300Dez_97S8G6_RW5QpQ8ef6X3wq8tyK-8wnXQ%40mail.gmail.com Regards, Vignesh