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 1vvw4C-00B7ZV-1i for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Feb 2026 11:31:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vvw4B-002mBa-1T for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Feb 2026 11:31:31 +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 1vvw4A-002mBB-2t for pgsql-hackers@lists.postgresql.org; Fri, 27 Feb 2026 11:31:31 +0000 Received: from mail-lj1-x230.google.com ([2a00:1450:4864:20::230]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vvw47-00000001TqS-2A3M for pgsql-hackers@lists.postgresql.org; Fri, 27 Feb 2026 11:31:30 +0000 Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-389fb626b67so18348601fa.2 for ; Fri, 27 Feb 2026 03:31:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772191887; cv=none; d=google.com; s=arc-20240605; b=GSv24GLfxVVMnl/yBzJ2iUDN0FBwHDdIaELKJd0hvOWmCVlAyhBeJHKZsK+W8SuM+h K4fqEVA2+Za18MqrsZMX35RKwBLtbcRMlW3+Vo10dbkVQy6Z1T2ZdGnCWKbn+5PvLlXw sPajG7KKIQqbIYdVKWxihQvR3b69PVHcXdhlIi9mmTl0P0m77OgH/CHmeBm8GFN8LjxP 6NNNXadtu8n1F3cioDSaMhd9t28BU5E1QeBQwn8yTOr5Wbq9gPWfGYqD8STrYZUeyh/e Rrcwmpa5FciKJCNPsTcwfghF/T4vdhP1ZJnf+3oWQigZIMKQ2GFyoNMQUj5qireasB9b yEEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=r3sFB3O+yoI1dQilOwiBq4iOnKQRboNLwAYeAmJg0Zs=; fh=qmvfybzA6z+AT/XKy9OEyE5nJEHuDrA/TOP5FGPLMEc=; b=bvBrhsB1PftlgAgsL7JhTFNRPJnqhXBfoWXZytNOJjqdqlSHCDpGOdJCyXAXVHo3DE 7wVxFLbJ2qBNM5AZ5p5Icv0aOYwE7piw5Dc5u9XVG/bXb+bCe4OwMPiEvcNECN1bMPe5 LFYdcsFZq3/QyP5vjACtfdMAZOKkUFQtMbYqzFLGSIhpsHb+V438ZBjbdexjRUhNb5V6 frwcxxa336a/02S4sajBJLtUDxtDT7KWossw1Pw7aJTxICNv3KKE4ka2xIpmefigInmr IcyeCoK4EGpyLmohF4yHwGo4U2HLc4uX6AS6h1PBCXq0Jd7R4UnkIGheOdAW942+MPLs cKlQ==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772191887; x=1772796687; 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=r3sFB3O+yoI1dQilOwiBq4iOnKQRboNLwAYeAmJg0Zs=; b=mNvCWxh83g6OEdSwDjdjJGYkk/UmAoeWi2u4Iz28YzN/4Hlea2nZ6qry4aODMKi3ij GqYLiKKhw3VPV6aDtc6/3hYT3/sQJ8X0p5tTevJIjhj920YqhlzqFI9u/y0qeSgTOZqu 7SFSdDr8QLipW8pmXz4gpJEVmRpI3b7FLDRgN1TTC1HPkxtrRksxEX+5OepcjTmaZU4y ZBFg3Y4+jcrWcVlFvwOK6xVMVHZ0z2y8/AvQ6gLuA/c7saaGPB5WEIPGPftlzEjTuG0h VKx4zAkIE+VaAdiT6U5zR6Wbwm8NeeTCB6bOBXGbxUZornTB2Y+lkd+aiQSS3GeJp5o9 djxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772191887; x=1772796687; 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=r3sFB3O+yoI1dQilOwiBq4iOnKQRboNLwAYeAmJg0Zs=; b=rxqaqeYapHGG3A5bZilLV3PjAUtAJ0DXyVqpfWrkD134RTIyw4G97iaJ2G3yh7633g Y0RcVncZGBHXfwxYtBMdvj9D+VXHjxtTwYr8iphYq0Tw+ZfxT2vZQ9GBCtT7OiPw1aRK GOR7y+FJGxhzI8vf9IaiFuMBNdj0vxBS8cD5hsuQp6NQPre693GVRAZ7046r+4L3olK7 YsNOAxOiSzKR6Cl9ZmYmLHce5jUySFbNHtR9uAi+UpSPJ56K4jrHS5Chpq754Nw8o7Rm A5dyJ3zN66MuGbjrNIMsqv736mHdPj+u3rJCC0oLVxolpNALQYap8604r+SsYQvhjZfs ca6w== X-Forwarded-Encrypted: i=1; AJvYcCU33rxH3LEfuK4/kEnzii/x/3ikszmRRd5RGBHPkPY1NiogNhUDfMwE2Db4jvImr1ZcKIkLOlw4BiJE2GVo@lists.postgresql.org X-Gm-Message-State: AOJu0YysRv4Mnc7aGRfpCZDC6xYPk6pMfGD/xxSJrT773CJ6S9NGV8YL RUw3Nup4871Zz0fMJQ0XFYIRZsa5HLZSDWh03s+UdM29nQjYtAbyEOTFibHIf2LHqGWFAiYbPsp oz4LPcCuQjqJ7NDLRwOo+gt71M4J6hw== X-Gm-Gg: ATEYQzwqafNxBTGy/i+lWaFZ6RIlNAK8iT5FW/1JcP4jP/i/x/TUiVII1htSIdiY58j lunA551eCGjp8aiPjoTA1y0JlHJrc02uGxZ32URJys2nvfXhQ/AlPmOglQq+IyyrguNpKdwoyDj D/L9EpOhgTsRhUEIfOvT2sp2YlVC9D83h0zqU3R5Rd5A7TsMGHpnSbYaxAD16z1zBD/IFD7m2Rn fXMmN+Umxb/1eH5YYCSibqYXBgTti5St4vEMkOegMnVt9CXKhgNvZjlfM1TSY8FyLkpbrCQUvpJ LqPtLb5ceZhW7Q== X-Received: by 2002:a2e:a549:0:b0:385:d0fd:df80 with SMTP id 38308e7fff4ca-389ff35b11emr21539061fa.28.1772191886854; Fri, 27 Feb 2026 03:31:26 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Nisha Moond Date: Fri, 27 Feb 2026 17:01:14 +0530 X-Gm-Features: AaiRm51emHZS-stXcV4hLF3TNJ09p7tp5zGHnm7iniITLYhaqaLhnC40f1w1DxY Message-ID: Subject: Re: Skipping schema changes in publication To: vignesh C Cc: shveta malik , Shlok Kyal , Amit Kapila , Ashutosh Sharma , "David G. Johnston" , Dilip Kumar , Peter Smith , "Zhijie Hou (Fujitsu)" , YeXiu <1518981153@qq.com>, Ian Lawrence Barwick , Bharath Rupireddy , PostgreSQL Hackers 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 Fri, Feb 27, 2026 at 12:10=E2=80=AFPM vignesh C wr= ote: > > Rest of the comments are addressed in the attached v51 version. Thanks for the patches, I am still testing the patches, but sharing a few initial review comments. 1) v51-0001: Bug in testcase - /t/037_rep_changes_except_table.pl The test_except_root_partition() is invoked twice with values true and false. However, from the logs it appears that both executions use publish_via_partition_root =3D 1. LOG output: 138 2026-02-27 12:26:51.167 IST client backend[72317] 037_rep_changes_except_table.pl LOG: statement: CREATE PUBLICATION tap_pub_part FOR ALL TABLES EXCEPT TABLE (sch1.t1) WITH (publish_via_partition_root =3D 1); ... ... 238 2026-02-27 12:26:51.600 IST client backend[72369] 037_rep_changes_except_table.pl LOG: statement: CREATE PUBLICATION tap_pub_part FOR ALL TABLES EXCEPT TABLE (sch1.t1) WITH (publish_via_partition_root =3D 1); It seems $pubviaroot is assigned using the argument count instead of the argument value, which causes both runs to behave the same. Fix is to replace the assignment as: 27 - my $pubviaroot =3D @_; 27 + my ($pubviaroot) =3D @_; ~~~ 2) v51-0001: File: src/backend/commands/tablecmds.c + ereport(ERROR, + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot attach table \"%s\" as partition because it is referenced in publication \"%s\" EXCEPT clause", + RelationGetRelationName(attachrel), pubnames.data), + errdetail("The publication EXCEPT clause cannot contain tables that are partitions."); + errhint("Remove the table from the publication EXCEPT clause before attaching it.")); + } In the ereport() call, there appears to be a small typo. A comma should follow errdetail() instead of a semicolon. ~~~ 3) v51-0002: File: src/backend/commands/publicationcmds.c + + /* Check that user is allowed to manipulate the publication tables. */ + if (excepttables && !pubform->puballtables) + ereport(ERROR, + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("publication \"%s\" is defined as NON FOR ALL TABLES", + NameStr(pubform->pubname)), + errdetail("EXCEPT Tables cannot be added to or dropped from non FOR ALL TABLES publications.")); } It seems the check is for both SET and DROP cases, but this patch is only for SET. Also, I find it a bit confusing, could be made clearer. Suggestion: - errmsg("publication \"%s\" is defined as NON FOR ALL TABLES", + errmsg("publication \"%s\" is not defined as FOR ALL TABLES", NameStr(pubform->pubname)), - errdetail("EXCEPT Tables cannot be added to or dropped from non FOR ALL TABLES publications.")); + errdetail("EXCEPT TABLE cannot be used with publications that are not defined as FOR ALL TABLES.")); ~~~ 4) v51-0002 and v51-003: File: doc/src/sgml/ref/alter_publication.sgml ... - remove one or more tables/schemas from the publication. Note that addi= ng - tables/schemas to a publication that is already subscribed to will require an + except tables/tables/schemas in the publication with the specified list= ; the + existing except tables/ tables/schemas that were present in the publica= tion ... 4a) After adding =E2=80=9Cexcept tables=E2=80=9D as a third option, the sla= sh based formatting may be slightly confusing. It may be clearer to write as: ... the existing except tables, tables, or schemas that were present in ...= . ... The DROP clauses will remove one or more except tables, tables, or schemas from the publication.... If the existing slash format is retained, there is a typo in "except tables/ tables/schemas", extra space after tables/. 4b) Should we add examples for SET/DROP EXCEPT TABLE as well? ~~~ 5) Inconsistency in EXCEPT TABLE syntax In CREATE PUBLICATION, the syntax requires parentheses, for example EXCEPT TABLE (t1, t2), whereas in SET and DROP it is accepted only without parentheses, like - EXCEPT TABLE t1, t2; Should we keep the syntax consistent across all commands? ~~~ -- Thanks, Nisha