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 1wSsWO-000ANB-2a for pgsql-hackers@arkaria.postgresql.org; Fri, 29 May 2026 08:24:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wSsWM-001z8r-34 for pgsql-hackers@arkaria.postgresql.org; Fri, 29 May 2026 08:24:47 +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 1wSsWM-001z8i-1Q for pgsql-hackers@lists.postgresql.org; Fri, 29 May 2026 08:24:47 +0000 Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wSsWK-000000005nv-1mY6 for pgsql-hackers@lists.postgresql.org; Fri, 29 May 2026 08:24:45 +0000 Received: by mail-qt1-x835.google.com with SMTP id d75a77b69052e-516d65a15f6so72053951cf.1 for ; Fri, 29 May 2026 01:24:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1780043084; cv=none; d=google.com; s=arc-20240605; b=HJ3QKyHUzPE058EaUdXsq5DpyXV86TuV1gwBijMBBTNhAAQv+VYqgilZwANUv6gIh4 TDBNVkMOANRhMOTtUiQN0mNdou2ltY13T2jtzqYBm2YsjFdJYhCvyXKKJfK4bib4e1x4 MRUdkpWCZCSvHa6HCO32+qpQPHZfb1MwSq1fnr/MMwLvtngjSe69dkH7jQ/8DrFd3+zp aTpZH5fUpKgqX2Q1lEFs4178dJEa7waygcn8D2nwNLPOnJLs+gpp04iIQLucFQhlPrEu z5wkj2TETgB2ThAafEXGZPXtL3g22fvWfw3PJNl3GYJte3Y3TFSMU2B8Sk6YCYMBsJUx PRYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=RFoAGu18imQqCuGNUxQ5+Mn2YmvgruKsRYMUGUOzQvw=; fh=85YUf6EqQTRC7j2bdBTe3ufZi5Ni5Vf1FfgdTyfuXWM=; b=JIoR2mZp5sYH+qxBCPIMBy668iIYp64fjFoMf8J/oga9mIT1Lm96MOmoPaHyxSKK6U oBp3T4vhJkuohivK0TxfV58XV5j8Uu7d+ybkMw2RdZeOqufkCdVre6v0fYgTNCIS1qrl r5/VC/g73qRKFXOdyqRIGwwQKjlv+ETQI6rzWJnUfk+S/L9zhyQaKpqzlN0/IhBOQauH 0nT0WEjqWHU+AOi/m5gqXr0FIQy/X1kiGZoJPgYrR0oJUXuPzkcjFkVCu2lXUR+GaDp/ Gswy1o/cWlv84RE5JwDymHzFi89ZMDaAjR3ay+DjgjWEqWtSZL+wKkY49yrYgQKQA5o8 Q56Q==; 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=20251104; t=1780043084; x=1780647884; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=RFoAGu18imQqCuGNUxQ5+Mn2YmvgruKsRYMUGUOzQvw=; b=pkjAAQQf3NCL0nUbNLSqSQ/kM5heahDZs6K6ofK8X1uBRi9lqdcbpPJrjjiA3iYL7k Dh00WoLaltm6aFsRrGlJuR2qZ00fqzYfYMhQc1Tte7RNxFOlopyPZnSABjOA282Rb53t T2zCccOD1Atsj5EVpa6qYRI69TF1bOgqaGJynoqyYGxQHqSqaZQl+gpyx3yBe08+Jow8 b2WbJQAPXUTQ0zc1ccheuj5+0+qCFRJTveAAf2nZiPdj8HN1n0yNbFFG6YRPJYv6mj3+ yFWF/1I3b0+QRIDTQK8d2jIy7wEXD/Jtj/JsN0tT1kQpX76ZNTgies1QwDJ2a2bmPuSj Uxog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780043084; x=1780647884; h=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=RFoAGu18imQqCuGNUxQ5+Mn2YmvgruKsRYMUGUOzQvw=; b=fw9kBKNcV2Ng7WOB9X1KxkXlSsKsMArtbPXhckDTOKQhxOZyjfYnAJHG2Hw4muH+eX 3tNnPj/Cr/xSE2LDF3KrVO6B9uD0SCBqH/YYhu2Ao3NaTI+3stEAzpj37uaWJcMQaDTj Zr0pAkLPjcvzbotSu/i0q1OhmBctoWZoKJzcAbgU+YtBbrGfbTZnJ0ib4wVCAvaANPGb CGsQ4AqNK75EfO6zVUBwjxmVegV7gOqx5l2YUTJ63p8C4C+nsp/knvuOXO9G2pJmPnZp UoQrobqR7uXZ38UWlEIm0barG4YMvr37ZtZy3naMUuRRS/zKXVG9oeImJpMuQUJZn6LB PILw== X-Forwarded-Encrypted: i=1; AFNElJ/v/7EMO38g31lsRwL9+428eNLRysGOmWLgGX05eOe+h/9BzzzZKe7kIWQEAvMfFt6yKmCQiHdyqT2sI6lN@lists.postgresql.org X-Gm-Message-State: AOJu0YxN9zHV9/XyLvzexwqTmC0HdVFkl5Ihq0+Ad/52BGHJIvuf+Nud jc58kgO0YXd6A0X2+fZTCURQEorRmgj1TN5YCwoDVEmlMXkAbvStPk92RFwKzPAp7FwjN1xRAcy z5JWQur6P804h0VHWYoq6xYvLYUX0PPs= X-Gm-Gg: Acq92OFan21zpHNTff6id8614dofcbkcgbRys3gkuSwwpAq64uuhlO0kVOHdjAE/lqT oFBcG54wWnxhEgpeDaKU8622+06aEG7vnizcCbMsunygr16KX5IYZGFQFXXbL/P1OBH6QOx9Znm vZL/QhxWO8oJC7Cc6oREV+08FZvdE2aM/Pa6Y5mrvdf4DydIGM5pNoqDmBJQ9/wObNFlm38YQTu Y9TbOZFAc2ZetFLIfs/XdNbrKREjPSe5Z70w34UtI1vSzWjKhUS+4MHpJ/mzo0UMJ15o6LpSJG6 O4kRT+efcfljcLbTJA== X-Received: by 2002:ac8:7c47:0:b0:517:146d:2cb5 with SMTP id d75a77b69052e-5172dc8772bmr18554481cf.20.1780043083946; Fri, 29 May 2026 01:24:43 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Peter Smith Date: Fri, 29 May 2026 18:24:16 +1000 X-Gm-Features: AVHnY4Jlfp0KsnR52JNfMqvBQHU8J9E6Vjr4dD0-TdXY7gmg35qFSq1we7DljYc Message-ID: Subject: Re: Support EXCEPT for TABLES IN SCHEMA publications To: Nisha Moond Cc: shveta malik , Amit Kapila , 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 Hi Nisha. Some review comments for patch v7-0002. ====== src/backend/commands/publicationcmds.c 1. +static void AlterPublicationSchemas(AlterPublicationStmt *stmt, + HeapTuple tup, List *schemaidlist, + List *except_rel_names); +static void AlterPublicationSchemaExceptTables(AlterPublicationStmt *stmt, + HeapTuple tup, + List *except_rel_names, + List *schemaidlist); Maybe the same doubts about the `except_rel_names` parameter/variable are continued into this patch. See patch 0001 where I first queried this. ====== src/bin/pg_dump/t/002_pg_dump.pl 2. + 'CREATE PUBLICATION pub12' => { + create_order => 50, + create_sql => + 'CREATE PUBLICATION pub12 FOR TABLES IN SCHEMA dump_test EXCEPT (TABLE test_table, dump_test.test_second_table);', + regexp => qr/^ + \QCREATE PUBLICATION pub12 WITH (publish = 'insert, update, delete, truncate');\E + /xm, + like => { %full_runs, section_post_data => 1, }, + }, + + 'ALTER PUBLICATION pub12 ADD TABLES IN SCHEMA dump_test EXCEPT (TABLE test_table, dump_test.test_second_table)' + => { + regexp => qr/^ + \QALTER PUBLICATION pub12 ADD TABLES IN SCHEMA dump_test EXCEPT (TABLE ONLY test_table, TABLE ONLY test_second_table);\E + /xm, + like => { %full_runs, section_post_data => 1, }, + }, I found those hard to read at first. How about just changing the test title of the ALTER parts BEFORE + 'ALTER PUBLICATION pub12 ADD TABLES IN SCHEMA dump_test EXCEPT (TABLE test_table, dump_test.test_second_table)' SUGGESTION + 'CREATE PUBLICATION pub12 test continues ...' (2 places like this) ====== src/test/regress/expected/publication.out 3. +-- DROP TABLES IN SCHEMA also removes associated EXCEPT entries +ALTER PUBLICATION testpub_alter_except DROP TABLES IN SCHEMA pub_test; +\dRp+ testpub_alter_except + Publication testpub_alter_except + Owner | All tables | All sequences | Inserts | Updates | Deletes | Truncates | Generated columns | Via root | Description +--------------------------+------------+---------------+---------+---------+---------+-----------+-------------------+----------+------------- + regress_publication_user | f | f | t | t | t | t | none | f | +Except tables: + "pub_test.testpub_tbl_s1" + Isn't this showing a BUG, because after the DROP the "Except tables" are still listed. ~~~ 4. +-- ADD: unqualified name is implicitly qualified with the schema, not public +ALTER PUBLICATION testpub_alter_except ADD TABLES IN SCHEMA pub_test EXCEPT (TABLE testpub_tbl_s2); +\dRp+ testpub_alter_except + Publication testpub_alter_except + Owner | All tables | All sequences | Inserts | Updates | Deletes | Truncates | Generated columns | Via root | Description +--------------------------+------------+---------------+---------+---------+---------+-----------+-------------------+----------+------------- + regress_publication_user | f | f | t | t | t | t | none | f | +Tables from schemas: + "pub_test" +Except tables: + "pub_test.testpub_tbl_s1" + "pub_test.testpub_tbl_s2" + Isn't this showing the same BUG as the previous test, because "s1" is still in the "Except tables" list, even though it was not part of the EXCEPT. ~~~ 5. +-- ADD: multiple excepted tables using unqualified names +ALTER PUBLICATION testpub_alter_except DROP TABLES IN SCHEMA pub_test; +ALTER PUBLICATION testpub_alter_except ADD TABLES IN SCHEMA pub_test EXCEPT (TABLE testpub_tbl_s1, testpub_tbl_s2); +ERROR: relation "pub_test.testpub_tbl_s1" cannot be added because it is excluded from publication "testpub_alter_except" Isn't this showing the same BUG again, because "s1" was already in the EXCEPT list when it should not be. ====== Kind Regards, Peter Smith. Fujitsu Australia