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 1w1LPL-000Dhl-1x for pgsql-hackers@arkaria.postgresql.org; Sat, 14 Mar 2026 09:35:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w1LPK-001RNu-2P for pgsql-hackers@arkaria.postgresql.org; Sat, 14 Mar 2026 09:35:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w1LPK-001RNl-19 for pgsql-hackers@lists.postgresql.org; Sat, 14 Mar 2026 09:35:43 +0000 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w1LPI-000000006YE-0EB1 for pgsql-hackers@lists.postgresql.org; Sat, 14 Mar 2026 09:35:42 +0000 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-38a3066b68bso27680361fa.3 for ; Sat, 14 Mar 2026 02:35:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773480939; cv=none; d=google.com; s=arc-20240605; b=Qz70LDCmw0s7iUK5Nf2n9S4VW3iHIWGRV6OKBPaj2KuUzfVqJy3SOWjsVk4EcLpKiv 9su7bWVWRSQflPYqovxujGca6fHCY8J4CUw5KQiD9gj4RfiMqkgQXZNLQ9/OgtgH9XOg Amt1lM++rj7kw9ySwpW+zqx0MD1Euj0z1aFATrU3xMZS/bVE2e+8RcVXA2ck6eNaZVX5 tZL5BJLTB1B1TIp8hRdOkTf3qe20rjsTlBItDj59qZ+im7vDdolvmnddE1W12/QUuCTq FYZFV7PLsRML2Z7b88Sx2GKECLDGO6tyjwNBYQXKUSGKEZKaJcN3jpw5iKD3i4eJiPdG Y9CA== 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=szGTSmAaz4aVHaNqiOGk45LE82BTDmwtHnq8s8r/JAY=; fh=GPEnKM0742po2Lva2o97gJUDzo3KZmeoNwpDaRGzSiI=; b=Z3V/QpNW2/e6Ma2fvlVEnp3lSc2zMdBXVGW5ji2bsTjOmg7CBSB62KknmFhOPcTMun eqMQ44St4AqFMu8CyL9p1NUVP5Gpi654ZuSx9yv7u8/gfXktdZqBO8N9MHasx4A7du3u wScyTcZLrCLI1RB/VIPNUA9uAjWlHMVlQjLObtzbNwBtRv8ATGocLXtpxm6MpQTvhdST 8eeW+aML45TFVHycfQkuJr+OAZtGI3TkklxDtB2liL8K3nnZ1y+PoH8TBKECz7Q90U6i 6nHr8DwKK5bX5vEUmRe0crwxkhaOUBRH0CBBeJ2/PuQ2a83VdTohr/2KDBOS3yKDqaU8 uGbQ==; 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=1773480939; x=1774085739; 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=szGTSmAaz4aVHaNqiOGk45LE82BTDmwtHnq8s8r/JAY=; b=ODSCV7HCpBFX/eUkkx+J9VgzwamSEneLOUJxeaet0osmJ6akhlHNVN3SGKg0bKzyPB m2Qm1ZleQ+6yDirOedWxdDZZKYYoE1ibffQjWWCdBKe0O5Z8M0rRFbbp4B8tHPmM6d9M WaIUQa4i4NUYQNrogSWafBMQRZdtGGlcFC/wmrnoHf6OZ99UmCmQWScryIKyib5sgiM4 0el2V4G/h+P5KxjO6hYc49Gu4GL/yFcrBzfZQgno8sgj6NxtwNR3PaeF93VNuuulHLI4 5J3KlTVSWCrM4yEEstqfPNCVU5AILGzr+Lin/7tIgFPSdibI3FYgVorSsxZa/aOB6AVq gLFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773480939; x=1774085739; 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=szGTSmAaz4aVHaNqiOGk45LE82BTDmwtHnq8s8r/JAY=; b=VcOPiUJuaA4bvplvFfpKf9WHG432QX9ZzoWxwrBEXgZWB4szjSJU5/DNZqHrT7kdnx ldjG21w+YDkvjjgJM++aRx286Ge5GrILNf7S6g3K9d7lXwOhsh9w+Tr+nCRkGtwrEy3F bs9oWawqoXFWY1nE9pre9aSI1p/u1NOVk1EeviOj+kcmtZlOrLPSiFf685H1fvvCsC9U X8pAZsiUW8zRToeSSz11wtGwzJsvHcUQuaxH+Vebj6gsMKTMfZ9QWKWgpfwD+eGKdK7d p0yqzIm0ultI9VRlTGZfBiAEa5A4S0d9Eh+HBy+FuFrsFpKrANefVECR4rvyjch/YwtG Bv/A== X-Forwarded-Encrypted: i=1; AJvYcCVDG/DMO7NSoNVOZJl182NZfqQr9oqUZthJUUrVlt4PJSRihaTjAGfXwxx7EhW7LNbtDwqnxmcc5QODy0AJ@lists.postgresql.org X-Gm-Message-State: AOJu0YyFd9gV7uUZbijgTb4O6bJuCMSq9+UpLqglu3saBY+8GbULjckf eDn2eInWOjjZ6hzw2vT+W3dUIPUkUK1r7oOsNon7ouSdILG23CeiPxDAhK8EAN4E3v6FtLeR1OX +rGuheNsoNPQ6oStURwlTrhbbToEW5Rk= X-Gm-Gg: ATEYQzyKBrFpB6B0vnEwzV+ptQhGyzT5z2g5v/AbaVnfcnMFryh7mYocZm7ozkn0IVo gVshCEOBje81kolR+7TKAzKlqNZ8IZGg5cpCFsdRQt7188hAyjkPLKaiWvypbbIbiCqfBgMnEoO vRnCBznovHecvUWjTBKmICc/9OnBvJwlZwhOE7AbPKmQiQn9tEjDkmPheVXLQQSlkupruQ9bJn/ +7YpF9regbt4A4o0xQzPzE/4lZ5qVKfPP8Bt3IOuZwJmEaslZ/KzdujxE5AABfu4ZyhxdeUaHlz 6MMh9B181ia80xf7d3Iosr0rfWiueTbyowehiKI0PDb1Y6reMrdNNXkeBttNQjs4HQc/LOxBMQ= = X-Received: by 2002:a2e:bc92:0:b0:38a:8602:7198 with SMTP id 38308e7fff4ca-38a89688fb5mr20604241fa.9.1773480938683; Sat, 14 Mar 2026 02:35:38 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Amit Kapila Date: Sat, 14 Mar 2026 15:05:21 +0530 X-Gm-Features: AaiRm52MthmPQDgWSL1_L_JEbSJbXmmLrDIsTLNMONht5qtknHL-7PI0hajDZvc Message-ID: Subject: Re: Skipping schema changes in publication To: Masahiko Sawada Cc: Peter Smith , "Hayato Kuroda (Fujitsu)" , shveta malik , vignesh C , Shlok Kyal , Nisha Moond , Ashutosh Sharma , "David G. Johnston" , Dilip Kumar , "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, Mar 13, 2026 at 11:51=E2=80=AFPM Masahiko Sawada wrote: > > On Fri, Mar 13, 2026 at 2:51=E2=80=AFAM Amit Kapila wrote: > > > > On Fri, Mar 13, 2026 at 8:55=E2=80=AFAM Peter Smith wrote: > > > > > > Hou-San (off-list) gave an interesting example of how it might look > > > when the example is combined with the hypothetical future ability to > > > exclude all schema tables from a "FOR ALL TABLES" > > > CREATE PUBLICATION pub FOR ALL TABLES EXCEPT (TABLE t1, t2, TABLES IN > > > SCHEMA s1); > > > > > > > So, if we follow this, in future, the syntax would look like: > > Create publication pub1 FOR ALL TABLES EXCEPT (TABLE t1, t2, TABLES IN > > SCHEMA s1, s2), ALL SEQUENCES EXCEPT (SEQUENCE s1); > > > > I think if we use the above syntax then one can also argue that why > > not use FOR ALL (TABLES, SEQUENCES) instead of ALL TABLES, ALL > > SEQUENCES. > > The same is true for the syntaxes of TABLE(t1, t2) and SCHEMA(s1, s2), > no? If we allow grouping the tables and the schemas by TABLE and > SCHEMA keywords respectively in exclusion lists, one could argue why > we don't allow it for the inclusion list. > > > > > Instead the current command would like: > > Create publication pub1 FOR ALL TABLES EXCEPT TABLE (t1, t2), EXCEPT > > TABLES IN SCHEMA (s1, s2), ALL SEQUENCES EXCEPT SEQUENCE (seq1, seq2); > > > > Though it is slightly lengthy it makes the syntax local such that the > > meaning of a clause is determined by what is inside it, not by > > something that appears ten words later. > > While it helps the syntax locality, I'm concerned that it could make > the context of the EXCEPT clause ambiguous. For example, IIUC the > above syntax rule would allow us to write: > > CREATE PUBLICATION pub1 FOR ALL TABLES EXCEPT TABLES IN SCHEMA (s1), > EXCEPT TABLE (t1); > > Regarding the second EXCEPT clause, while one might think it excludes > t1 from ALL TABLES, one might think it excludes t1 from the first > EXCLUDE clause (i.e., the publication actually includes t1 in the > publication). > According to me, the comma between EXCEPT clauses breaks such a chain of thought but others may think differently. The docs can clarify such a confusion if any but if multiple people interpret it the way you think, I am fine to go with the direction you are proposing. I am slightly worried that both syntaxes have some pros and cons, so even if we change to what you are suggesting, one can argue to go back to previous syntax as that also has some merits. So, I feel we can complete the pending patch [1] and try to get the opinion of some other people unless changing the code to support another alternative is difficult. [1] - https://www.postgresql.org/message-id/CALDaNm1SGJtJq_W68khExG1EL4ZmyZ= 2U7JSc1Z3FsYr4nSbi_A%40mail.gmail.com --=20 With Regards, Amit Kapila.