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 1w0t9J-002IOu-1K for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Mar 2026 03:25:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w0t9H-001ZCb-2Y for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Mar 2026 03:25:16 +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 1w0t9H-001ZCT-1D for pgsql-hackers@lists.postgresql.org; Fri, 13 Mar 2026 03:25:15 +0000 Received: from mail-qt1-x82b.google.com ([2607:f8b0:4864:20::82b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w0t9F-00000001sOr-2q8Q for pgsql-hackers@lists.postgresql.org; Fri, 13 Mar 2026 03:25:14 +0000 Received: by mail-qt1-x82b.google.com with SMTP id d75a77b69052e-509006c070eso15065021cf.0 for ; Thu, 12 Mar 2026 20:25:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773372312; cv=none; d=google.com; s=arc-20240605; b=Zl9maX07zbcsoeaXgZG2v7HEIhv/4h9TU+zZAIHHC3e6miMrCnRnPovEF6BsrS4q5Z TXuUISBJtcxjJMen/b2gZfnsvx7SK+fo/2ADPl1xKqv4FoWa1ZQK+qWlE76ZHaE2xDiM x4YXbY9YBMDamnZekHejtY4d0jf+m6YChkh/0x5FwTnjuYq5OUtToPJ9ujz87PKsP7Ew NmYGsMueWEy5D4sC1mQIfdY3myOAuRyeUOyrgSpJb/Kbh3Mn7YQufxL9q9dDaBiCEa2B lwkiV5TYbzkZhL/+JyAwkPOLkEn9mj99oy8JEP2+lNLcnpjk6M2XKi26bAbZHTAVdSB9 W/bA== 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=UrqfKhIOQmAFsTgxZe5ZlUyXnlk59aOzkq1lX0sCPMI=; fh=C5wDzHfPIaNtbL3W7PMoUc+PVUzRkAf+ypCAt8C7Jos=; b=DAqandhIb7Y8pQDTBrhL7BWlxznBg3DDnQBDxrERrNYAwA/Rga1DaBSQUKmFcPJkfM yrR3mOrBOksLAsxEdCo9YZ9sDgZ8xT3isl2BioMb5JCE0s+/qOlDImtEkxdMkfiDcZMU K4xGNbx2pvz5379Dgu33YA2fxUwAI2IUEEEErVpstzNaONKImI0rg2KrIVZ6qaft76O7 /1DxJok9Uxt0U+W8D7XOql9GubLyNzXl8SRkhkt2bjFfCLkYHs2SpDAg7BNZv42GomNq 0Cy0JA/OQnhKsouajzCP5mPQJ4HCsobEIgh4ZmZ7iWK8Saw7i/Y0slsCoQbFYQqbvLJi dRwA==; 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=1773372312; x=1773977112; 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=UrqfKhIOQmAFsTgxZe5ZlUyXnlk59aOzkq1lX0sCPMI=; b=BvCqwCMF/NNQLjc1VpfT2fDmXh2auhKshPamHLl4bQjX+RgL2pZ0YczInu7OgVJg3E zxcmE7OXex05yHiKL2L75EcTtJ8slPHgZakOyF+C2EPCgpbkffSw/vU4E3gsIggJgEbD 6RLVVT50KtXHn/F3+XHwQt33ahSkfGOmicWzLNag+YgOFXfWoICEwq55dtuIAHfasdIL d4yiSEhfJ74MdZzWELM2d5X5zCED8kgd3CUJTj/J6Cp2tuBYQnUIjvWcqZR91h5azyR0 qOFSFfki7h8dLHPXzfx/jHbVAVHxCsCo4Z/aNaabuKZSXZybdVfzNt164z4b0vEFAz9+ 4shw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773372312; x=1773977112; 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=UrqfKhIOQmAFsTgxZe5ZlUyXnlk59aOzkq1lX0sCPMI=; b=TsCFTCouF8drMey5vFnbVJZyyBJtjZ7UehXwdbE2zpfE5bqDorBu748Tav7TtY9SJ+ wxJwnW9s1uOWTNi0b1GImR7Wxi6MG1cON1lhrGUMIvFQ3p5hLvkc370wmv0MxR4N/Ahi q9hT/zxWA1z8DnBuQeHHFATc5+vvaxRvahwe/677iU+dTlW3uPHdNxCQCI1OcSXkDwqc oPwUrjhmSTMIc17VkxEGE/+0FKCsfBMcCvRvFgmurNHV4LGGWeD/Q7IYDcUMtUUL1UgN XJICNNaVipeGODlg6dzuERjnId7OcWxZN1XlLQjQ7x1l2Ryzg3q2K1drF4mx8Fjkiov7 kFoQ== X-Forwarded-Encrypted: i=1; AJvYcCXGR0lOz0RQ2tYXQpR2MOVEsQDPjtlJHXyzRTebSupRGHwSvjloLQkFytd7NVZxpoifwd7GKlcFIjl06jMC@lists.postgresql.org X-Gm-Message-State: AOJu0YyFMwxJezvnWa0ZIi4QtkmkykGmbuaPOk3TkxMuNd8jZNO/qHms 3a/h+x4u8LBFFfM034jjCVlxGBWPd7omwo/0EeGRiA9+thwOTqBY4sOpH8IohGPyFIrVS6mi6RV wK2ni/+alDYYwYVmg8tz6B8eCeS8w6X0= X-Gm-Gg: ATEYQzycF3IpXXs96L5A+HwYRnurYLnEvFJ1wjs55HX2STEGPvJWlM1mRt95r4sQjRF gds+e766YjZyM7sWBK+zDGGWrA9P+VCsJz1WClBEKDvlJSBrD01t6XGbL1KlSCVXUoWzNrcz7Po wPdt3lNeAehAl6c/0DxvC7Ta97fKKis90IUS/k1JRDgMcdL9X/v787radNJYzhUZUkrAWz3LKZG DsIEPOPk8Gb+Fgxwh9tjgR+xFiJgu+dXLHyOLoZz5OBKs8dpUlqtp7tn21zyiDrHErv6paFkB9f en1RKdE= X-Received: by 2002:ac8:5946:0:b0:509:2222:4202 with SMTP id d75a77b69052e-50957e65448mr26199641cf.71.1773372312088; Thu, 12 Mar 2026 20:25:12 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Peter Smith Date: Fri, 13 Mar 2026 14:24:45 +1100 X-Gm-Features: AaiRm529JqsI7FN7FRT8n-F6wV8iQB_bAbYL7ou5shseJc5mhQyxjieiugZYayk Message-ID: Subject: Re: Skipping schema changes in publication To: Masahiko Sawada Cc: "Hayato Kuroda (Fujitsu)" , shveta malik , Amit Kapila , 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 3:46=E2=80=AFAM Masahiko Sawada wrote: > > On Thu, Mar 12, 2026 at 4:50=E2=80=AFAM Hayato Kuroda (Fujitsu) > wrote: > > > > Dear Sawada-san, > > > > > I'm still unsure that the syntax like TABLE (t1, t2) for the exclusio= n > > > list is syntactically correct. The syntax of TABLE (...) is already > > > used in a quite different way as follows (borrowed an example from > > > stats_import.sql): > > > > > > CREATE FUNCTION stats_import.pg_statistic_get_difference(a text, b te= xt) > > > RETURNS TABLE (relname text, stats stats_import.pg_statistic_flat_t) > > > BEGIN ATOMIC > > > WITH aset AS (SELECT * FROM stats_import.pg_statistic_flat(a)), > > > bset AS (SELECT * FROM stats_import.pg_statistic_flat(b)) > > > SELECT a AS relname, a_minus_b::stats_import.pg_statistic_flat_t > > > FROM (TABLE aset EXCEPT TABLE bset) AS a_minus_b > > > UNION ALL > > > SELECT b AS relname, b_minus_a::stats_import.pg_statistic_flat_t > > > FROM (TABLE bset EXCEPT TABLE aset) AS b_minus_a; > > > END; > > > > > > Wouldn't it be more appropriate to use a plural form or the IN > > > keyword, such as EXCEPT TABLES (t1, t2) or EXCEPT TABLES IN (t1, t2)? > > > > But there is an existing syntax to list target tables, FOR TABLE t1, t2= , t3..., > > which does not have the plural. Current rule is to use the singular for > > specifying the exact table, and we follow. > > "TABLE t1, t2, t3" and "TABLE (t1, t2, t3)" are different to me since > the latter reminds me of TABLE (...) syntax for defining a returning > table. > > > > Or if we might want to add multiple items in the EXCEPT clause in the > > > future we can have parentheses around all exclusion items as follow: > > > > > > CREATE PUBLICATION pub FOR ALL TABLES EXCEPT (TABLE t1, TABLE t2, > > > TABLES IN SCHEMA s1); > > > CREATE PUBLICATION pub FOR TABLES IN SCHEMA s1 EXCEPT (TABLE t1, > > > TABLE > > > t2), TABLE t3; > > > > I agree those alternatives could work, but one downside is the redundan= t use of > > "TABLE" when many tables are excluded. If we want to stay consistent wi= th the > > existing style, perhaps we could write it as: > > > > ``` > > CREATE PUBLICATION pub FOR ALL TABLES EXCPET (TABLE t1, t2, t3); > > ``` > > > > Because we have already been accepting the syntax like "FOR TABLE t1, t= 2, t3". > > > > Yeah, we can omit the TABLE keyword for the second and subsequent > tables. My whole point is that using different syntaxes for the > inclusion list and the exclusion list would quite confuse users. > 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); The syntax starts to look more complicated when there are multiple schemas, but IMO it is still perfectly fine. e.g. FOR ALL TABLES EXCEPT (TABLE t1, t2, TABLES IN SCHEMA s1, s2); AFAICT, it is doable. The synopsis syntax changes are something like this: ------ and publication_all_object is one of: ALL TABLES [ EXCEPT ( except_table_list_object [, ... ] ) ] ALL SEQUENCES and except_table_list_object is: TABLE except_table_object [, ...] TABLES IN SCHEMA schema_name [, ...] and except_table_object is: [ ONLY ] table_name [ * ] ------ This gives the user flexibility to name the type however they want to: e.g. EXCEPT (TABLE t1, TABLE t2, TABLE t3) e.g. EXCEPT (TABLE t1, t2, t3) e.g. EXCEPT (TABLE t1, t2, TABLE t3) e.g. EXCEPT (TABLE t1, TABLES IN SCHEMA s1, s2, TABLE t2, t3); You get all the flexibility (e.g. which ellipses are expanded) for free from the grammar, and it is already very typical lists in the existing CREATE PUBLICATION command, which allow things like: e.g. CREATE PUBLICATION pub FOR TABLE t1,t2, TABLE t3; This syntax LGTM because * User is not required to repeat TABLE keyword multiple times (but they can if they want to) * The exclusion lists inside the EXCEPT look and work the same as the inclusion lists of CREATE PUBLICATION =3D=3D=3D=3D=3D=3D Kind Regards, Peter Smith. Fujitsu Australia