Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vQdVT-00DFnJ-2F for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Dec 2025 03:26:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vQdVS-00B0qD-1R for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Dec 2025 03:26:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vQdVS-00B0q5-03 for pgsql-hackers@lists.postgresql.org; Wed, 03 Dec 2025 03:26:18 +0000 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vQdVP-002r3L-17 for pgsql-hackers@lists.postgresql.org; Wed, 03 Dec 2025 03:26:17 +0000 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-343684a06b2so5904925a91.1 for ; Tue, 02 Dec 2025 19:26:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764732374; x=1765337174; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=utLSay4MArX4Y4FrEg8nXjnbTpLb8okoDkJQg+8xZas=; b=hFSeGgunpApIeJXN1kfBXxGK63JEc8v201+kV04mnd/UAEDKtt/nII2/57kEYO7h8G DiieehJI++0hr5d31ec5oIZ8RsCYyuyMJCtrpbCiBpYC5IfEokbLDHG9mVnFlptk+vzv O818lTqKk4itFkdhqIzYT3iln9BXrHhzf4lrst1vUi+tMETiyJfkZsJ7o69rMZFUe94v 4i0E6j6cC+0yFH3PVTyDTjXaRuK7SMLu8Xr6/k6ZF4iranxmHiYVrGpVC9ldBtX7sScT fwRvpnmhaEzhgvaOwoZyddqb4s9B37BVx+kGVy3gC5Eh/awyH0pNOogpH23rtZV681uQ ZP6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764732374; x=1765337174; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=utLSay4MArX4Y4FrEg8nXjnbTpLb8okoDkJQg+8xZas=; b=wj+jxjKggrzLw7JqN/tZ963ugP8WWnsNsjTh9bSPVcjAmGoa6VaIQOWdnefUmtocMq 5xToELrLaaK+qKUNGZ47FtoGpvLlrUCGY73xK+Jynnv5BL05EkHG0A42HIXCn51BLsbN OZ4m8/PTUOCegV3he1B4SBOrLc+NjzpnhKpfP1IFTm9pqoO51I9KiIJ3+BZj9xzLlM/9 BJUC+iCoZPSAUN1qXpVG2UyTNP5Ofe4fhCrGq+1JVp6Ttdm38D4RqT8CxCAXNjRe4fvb ytPUoLrOxzkCUn1rff4xoVDbA7iYYVi+PYKVVzaLYkt3dD3lrrJXGUZJSEa8oiEcyCFH DoZg== X-Forwarded-Encrypted: i=1; AJvYcCWN0YJX6Ny46evL9z3v4fezlgXYPsj6KR5JZPEZzPbE6AxUyrQUVU/kLSIj8mqEkOjmKpYTMt3UWNqV+Qqr@lists.postgresql.org X-Gm-Message-State: AOJu0Yzyho9QkJ3Y6IdOtm5cAz9RWFy5NLnUGQ+7bND0gTVuWWVzJP9a x3A1s//6RqP7QL55hBWimKLbO2ePgVWcmBsDkjI9udVVLBad2Hc83OKr4mV6EGo3NgOIOZYG+wD LStE0HR3GqbBs6SHedS3dXBh0lUWUCAg= X-Gm-Gg: ASbGncvxAeO8rFfwSq+FQqxm0ZL1d5k/Raixqo2pXcS8RHwQxRXJXcRzwypfQBi9g6/ O/1bVikwh1guVR06yhhQHvQSI5h4Hv8rTJ3uRZDSOVVctJlONaVRIC6/kgv1EsTO1YX41HDfC+6 xuLDI1i7VKlRVTScq8IZTTCLexdeswDSOQbU/+tfarDJRm25jfB8JyUmfVFzGwv37TOZH5FIpkl 8HWFgPFww5LwJyhNUr2gnQy5xap0Zmi70Y1/608XG6bK31UWbfT7vmTc+vXjc3RYpi0cNbVzmdC o6pFKeePh8cmA+uX6RtOYdoUJaI77EsP2TXQAnMbAQ== X-Google-Smtp-Source: AGHT+IEazwbZW2oLf3MjRrM9dZVokDmUrfIhz8qS0FXf6jAHL+YUDtJ65Xv3vr6VeNRoLIhpOR05zO0otwnmnYQZKyg= X-Received: by 2002:a17:90b:4a51:b0:343:bd86:b5a6 with SMTP id 98e67ed59e1d1-3491270bc30mr966195a91.34.1764732373577; Tue, 02 Dec 2025 19:26:13 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: shveta malik Date: Wed, 3 Dec 2025 08:56:01 +0530 X-Gm-Features: AWmQ_bljiUMyoSL8zYD7JOSvxOWnllXhx6OQBumYtVHKoumqDrPQaDro_FvlFrg Message-ID: Subject: Re: Skipping schema changes in publication To: Shlok Kyal Cc: Peter Smith , vignesh C , Amit Kapila , "Zhijie Hou (Fujitsu)" , YeXiu <1518981153@qq.com>, Ian Lawrence Barwick , Bharath Rupireddy , PostgreSQL Hackers , shveta malik Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Nov 19, 2025 at 3:34=E2=80=AFPM Shlok Kyal wrote: > > > I have also addressed the comments in [1], [2]. > > [1]: https://www.postgresql.org/message-id/CAHut%2BPtRzCD4-0894cutkU_h8cP= NtosN0_oSHn2iAKEfg2ENOQ%40mail.gmail.com > [2]: https://www.postgresql.org/message-id/CAHut+PuHn-hohA4OdEJz+Zfukfr41= TvMTeTH7NwJ=3Dwg1+94uNA@mail.gmail.com > Thanks for the patch. Please find a few comments on 001: 1) + bool nulls[Natts_pg_publication]; + bool replaces[Natts_pg_publication]; + Datum values[Natts_pg_publication]; + memset(values, 0, sizeof(values)); + memset(nulls, false, sizeof(nulls)); + memset(replaces, false, sizeof(replaces)); Can we initialize all 3 like below? Then we do not need memset. bool nulls[Natts_pg_publication] =3D {0}; 2) AlterPublicationReset(): Can we reset the columns in same sequence as they are originally defined (see pg_publication_d.h), it makes it easy to map when comparing/reviewing that we do not have missed any. 3) +/* default values for flags and publication parameters */ ... +#define PUB_DEFAULT_VIA_ROOT false +#define PUB_DEFAULT_ALL_TABLES false +#define PUB_DEFAULT_ALL_SEQUENCES false +#define PUB_DEFAULT_GENCOLS PUBLISH_GENCOLS_NONE These too we can rearrange as per order in pg_publication_d.h 4) + COMPLETE_WITH("ADD", "DROP", "OWNER TO", "RENAME TO", "RESET", "SET"); Is it supposed to be in alphabetical order? Looking at others, I do not think so. If not, then I feel 'SET' first followed by 'RESET' seems a more obvious choice to me. See similar (ENABLE followed by DISABLE): COMPLETE_WITH("CONNECTION", "ENABLE", "DISABLE", "OWNER TO", 5) +DROP TABLE pub_sch1.tbl1; +DROP SCHEMA pub_sch1; We can use 'DROP SCHEMA pub_sch1 CASCADE'. Then we need not to worry about dropping the associated table(s) (even if we create more in future in this schema). thanks Shveta