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 1nvaf1-0002P8-Fw for pgsql-hackers@arkaria.postgresql.org; Mon, 30 May 2022 08:21:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nvaf0-0002w8-CT for pgsql-hackers@arkaria.postgresql.org; Mon, 30 May 2022 08:21:58 +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 1nvaf0-0002vt-2s for pgsql-hackers@lists.postgresql.org; Mon, 30 May 2022 08:21:58 +0000 Received: from mail-qk1-x72e.google.com ([2607:f8b0:4864:20::72e]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nvaex-0002o4-6F for pgsql-hackers@lists.postgresql.org; Mon, 30 May 2022 08:21:57 +0000 Received: by mail-qk1-x72e.google.com with SMTP id 190so10818837qkj.8 for ; Mon, 30 May 2022 01:21:55 -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=gcQ9uALCoefJgEDhyirRwclLBb1PLL1c6Ugqhh4Y91Y=; b=ARDbC5o9T2+DJxRGnCb0M76uOpJmBlwX9B0aw/uJZrMHGOX5Qoa0LTMonwXjNekYGt 4qMs3M2y0ajBtTgRgstIBxcB+XgSTG6oj98vJjKaovWhwLRjAugCw+J6RNKB+R1YJIVW crlR1A+V3hcSg72qFVVtb5CgokapFvZWhBYDp35cK8G3HXs0uuIupmI64pfNPE51/9E3 19rnjRP6LBvGctxuB8ZOvyPNU9A7K2DJp8RJSFa5K8X/7k+72MGzE2oTDSZF3xeOVoSv un81BBUWwKVK6tgJJmAnhRalInkmR5uq78XoU+6odAjcUZWtuUig+Ct+e423jV8p4Hp5 Xi0w== 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=gcQ9uALCoefJgEDhyirRwclLBb1PLL1c6Ugqhh4Y91Y=; b=dSF/kQLYI8e+tW2gZuuwHrY6f/DgqseFLfTxtCBmDi2foh73KG52SF+MsvEnC0b07K q9/unnUkCZZV/S/NsFzME0tu4euIHPCZm7CzSSV1Deo8niUbNwMKuIfSNbhPTHgwqEXu bi2EFoYx9HSZtb73qxWWmZLQn8ta4j7xLvA4cby/CRgYEZ4DHl16bMiBiGeWDl4KQlEp SmbboB4UPXpnHvN3R/VOtbuYV99hSEs9otTHc0FBgjxOXoaFSMq3rzuUUcXjaqEc97xw u/D6ectjkpbptdsWrYYZilAGBL7jtY9xlP9pmdUSKFEItPAV4VK7LQlfpnNsWfJLdH4m cKwA== X-Gm-Message-State: AOAM5307KN8uR564St8OTTHCJfsoCtLC6nWdC0NPRhfa41UHPpZPz1c0 h/ReEsl+v5HCulFT53lSqDYEqq7jnCgIFaXRF3g= X-Google-Smtp-Source: ABdhPJxhWknQ08Tb3ZBFzH150Uj3ghxeBRxQ47nV4NWntDQSp8hePq2+qmmEzQuM8VTiwrXO3tvBkkbuw1Ynn2w/dCk= X-Received: by 2002:a05:620a:470a:b0:6a6:3c96:6689 with SMTP id bs10-20020a05620a470a00b006a63c966689mr1240656qkb.469.1653898913558; Mon, 30 May 2022 01:21:53 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Peter Smith Date: Mon, 30 May 2022 18:21:36 +1000 Message-ID: Subject: Re: Skipping schema changes in publication To: vignesh C Cc: "osumi.takamichi@fujitsu.com" , 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 Here are some minor review comments for v7-0001. ====== 1. General Probably the commit message and all the PG docs and code comments should be changed to refer to "publication parameters" instead of (currently) "publication options". This is because these things are really called "publication_parameters" in the PG docs [1]. All the following review comments are just examples of this suggestion. ~~~ 2. Commit message "includes resetting the publication options," -> "includes resetting the publication parameters," ~~~ 3. 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 flag to false and + dropping all relations and schemas that are associated with the publication. "resetting the publication options," -> "resetting the publication parameters," ~~~ 4. src/backend/commands/publicationcmds.c @@ -53,6 +53,14 @@ #include "utils/syscache.h" #include "utils/varlena.h" +/* CREATE PUBLICATION default values for flags and options */ +#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 "flags and options" -> "flags and publication parameters" ~~~ 5. src/backend/commands/publicationcmds.c +/* + * Reset the publication. + * + * Reset the publication options, setting ALL TABLES flag to false and drop + * all relations and schemas that are associated with the publication. + */ +static void +AlterPublicationReset(ParseState *pstate, AlterPublicationStmt *stmt, + Relation rel, HeapTuple tup) "Reset the publication options," -> "Reset the publication parameters," ~~~ 6. src/test/regress/sql/publication.sql +-- Verify that publish options and publish_via_partition_root option are reset +\dRp+ testpub_reset +ALTER PUBLICATION testpub_reset RESET; +\dRp+ testpub_reset SUGGESTION -- Verify that 'publish' and 'publish_via_partition_root' publication parameters are reset ------ [1] https://www.postgresql.org/docs/current/sql-createpublication.html Kind Regards, Peter Smith. Fujitsu Australia