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 1viRmD-006VCV-0k for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Jan 2026 06:33:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1viRmC-005D9f-0c for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Jan 2026 06:33:12 +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 1viRmB-005D9X-2l for pgsql-hackers@lists.postgresql.org; Wed, 21 Jan 2026 06:33:12 +0000 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1viRm9-001fQb-33 for pgsql-hackers@lists.postgresql.org; Wed, 21 Jan 2026 06:33:11 +0000 Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-34c3259da34so3240415a91.2 for ; Tue, 20 Jan 2026 22:33:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1768977187; cv=none; d=google.com; s=arc-20240605; b=cIxlyZn24LTYzOoe4KfCWzntkDMwxlD7LkceIqrPPm64Zg74QaU2Gsc2zgiV8yqtJM FA3D+9toaw3hZVlhjMel3d4aasesIcEOsKkn5ikaxF57EUlxn8cAFZbvtB+dkGCIc7MB FzdHNJV1TaWgutYU5RcAQJ1r7OTzjHv/8o6dACMGlLhdfx81lgtYOVQHRGSIMaRXqLzY Dq9YvhT+vbe0xe5btbWIEAK7cq78Rk/hMSsKptb0pMigPf6HGcdIpMRiCj239y7cj1rj 7GYEGkevshGWzdJpYxSk0s0JqOc7bcS8g7ryq4u6Snq41Kp4Q8qeC26yOsfPgTXWBQQh sD1w== 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=ZufkZ/E4o3V/U2TDW32pwXHCOum5IC4NaMyNyq5y8/0=; fh=hkCCsB+XAWoBjN6ybUX1OqFDp6XOXid7CjSDcjnIpM0=; b=cEyNREeLY4PegOEg6zlnun2bqeyBrtbrpXEVDIiFUmVOZA5OOUo4h8Lt1LnDcirjW0 Nn6zrGhsHrn/gL4uRsHNsBozcTgMu4wpi+cO/C9GAmZevIQiVW6MXlU5KwXSPFLz17Qp 2n4Y11ViFOdF7KihTRvbSZVCMHP+PZIE33OFfntrhPl2Wy5faJzUNGLPCXXO0+nuqzKy xRhL+KxXa0PAC/mLcZV6/p9xd7K6LkcZymFbibD2AztyiiPaOwRdwvvf0AMdtJPuTSDL xJMS7AX2ADMnSE5nt7kuASm/U6pLsL1b08PvNv1Wmfyqly9DiX4bK8hkwBYt6InIIOHH OBiQ==; 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=1768977187; x=1769581987; 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=ZufkZ/E4o3V/U2TDW32pwXHCOum5IC4NaMyNyq5y8/0=; b=Hkqz06l6gT7DLz/UU26744W7nw4GZ5qGW9s1goWZXJbH+zNt640PbUV7wKAuYnx2U4 JXTK1sen9nn9y/NWEYvGOUbWCk7ScYaxZvr2m9cOzoVH8oQGhDrjElggtoL6MeHzP6Hr 77fJvf4fs5ohoxELC98fcw5HXkBMLJPTM80FELmpggBag2wHI2ZPOz8R6QZdqS5pUVuH 5ISHi8mNB+aMXyYcvtqD5VTzCvqrCqH707q1ZT56Skp/iUCqi1tkfE93VW6pqlFmcbcI AT5iLM6dkSMaGXe52cxBcNjy+Eew7KqjtqmLAxNUEvcbBCJ1svUB42R88C0XQtT2E1N6 oEKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768977187; x=1769581987; 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=ZufkZ/E4o3V/U2TDW32pwXHCOum5IC4NaMyNyq5y8/0=; b=DDTAiuSn/wNDouIkuERukm5M9YZlbRGmDBeRARAuNpG0j45pK7S+EBK5eV5MW2adeN 43cjLOH9WbOYv38QmLNJJpjYFjqxP9S/OODC2X9/q3d2leWgCjl9+nKdwXyg/IwgjWZm 51PAiF5Dyf79bum6MAjYKY4UBZ9+k71wodDIGVRDZfgY/jIPe2Jh4+ppNMRtRcFscp1o Q0VWEnZu5W4zS3fGYm4N7T6f8Fkks5ve6/onvbJrEDEbd1ZyC5Knio0hPunt+wHCLIgd MujAjI9M95PBc+JcoDmS4zQeyqt1GSOgGIv9DdmZCp0J5cgkD4MSkJlqZEbTynJysJKx 561g== X-Forwarded-Encrypted: i=1; AJvYcCXEKWNKUrjSwMcv+HvAVFfJRRl4/y92r2skFzEfb8yU8REOGbhEyE6EyIc52sDGs7tDniTq84r3rDSvvUHa@lists.postgresql.org X-Gm-Message-State: AOJu0YzJBU0Ca5D3xy62TSZM4QUEcYw6d14t7j41Tz4p6xUbpwDtBUAi zoKSn2z5ZSMokFm3gEf0Sq/R4aDitfITayt5/UuC5fPBapC6+KyuPjY/MLIf/UYisK70bTP+jRl t8Llv7ss6F4rEfC0d5g5l8QhIcwJZYQ8= X-Gm-Gg: AZuq6aIAylw53jrlWS5X1VoPjsPxSqxHyU4HBQUjRMck2pZLzHBsrhVELtu+FD4loh3 B+Syu6OAfmjRctLj1rfvajwQw8E6vF6DG+/0kdctqWKhGpCwzcvz283lOt0v7vkf9sEFoILFrjD 0/+4tvkwLF8LHpxnAmsIlfVOeUfrvjcG8myCkX6kKsz0lTHNSReqR8uqNm0q1OplQRO4BvXKXN/ x4MeI7yGlrdLZ3BMYI3s97vfHCg9VDEEsH00zE/WxEhg7/x4xXNFNEejhYqp5m5gD6UxVC8tEtu RCOAxAV6oGIpzWeY6YjG5vbXYKCvSnWA7Wa3JBq1lUXDl4U3Aws= X-Received: by 2002:a17:90b:4d8d:b0:34a:e9b:26b1 with SMTP id 98e67ed59e1d1-35272fb86b4mr15819369a91.26.1768977186783; Tue, 20 Jan 2026 22:33:06 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: shveta malik Date: Wed, 21 Jan 2026 12:02:53 +0530 X-Gm-Features: AZwV_QjyOi8jMkgrEkW2Galb4FGvcOEpFEuQlypapE1ujHcErj2BbKiP0iz1C5M Message-ID: Subject: Re: Skipping schema changes in publication To: Amit Kapila Cc: Shlok Kyal , Peter Smith , vignesh C , "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 Fri, Jan 16, 2026 at 4:59=E2=80=AFPM Amit Kapila wrote: > > On Tue, Jan 6, 2026 at 6:13=E2=80=AFPM Shlok Kyal wrote: > > > > Also addressed the remaining comments. I have also addressed the > > comments by Peter in [1]. I have also done some minor cosmetic > > changes. > > > > CREATE PUBLICATION pub1 FOR ALL TABLES EXCEPT TABLE (t1,t2); > > Did we consider using EXCLUDE instead of EXCEPT? In another similar > feature being discussed, the community is proposing to use EXCLUDE to > SQL Standard, so won't it be better to use EXCLUDE here as well? > > [1] - https://www.postgresql.org/message-id/63e1587b-4258-41de-b823-948f8= cc692d9%40eisentraut.org > I am listing all current usages of EXCEPT and EXCLUDE to decide us better: EXCEPT: 1. Set Operator (EXCEPT / EXCEPT ALL) (docs at [1]) Syntax: query1 EXCEPT [ALL] query2. EXCEPT returns all rows that are in the result of query1 but not in the result of query2. Example: SELECT id, name FROM employees EXCEPT SELECT id, name FROM contrac= tors; 2. IMPORT FOREIGN SCHEMA =E2=80=A6 EXCEPT (docs at [2]) Syntax: IMPORT FOREIGN SCHEMA remote_schema [ { LIMIT TO | EXCEPT } ( table_list ) ] FROM SERVER server_name INTO local_schema [ OPTIONS (...) ]; LIMIT TO (table_list) =E2=86=92 import only the listed tables. EXCEPT (table_list) =E2=86=92 import all tables except the listed ones. Example: IMPORT FOREIGN SCHEMA public EXCEPT (audit_log) FROM SERVER remote_pg INTO remote_import; ~~ EXCLUDE: 1. Exclusion Constraints (docs at [3]) Syntax: CREATE TABLE table_name ( column_name data_type, EXCLUDE USING index_method ( column_name WITH operator [, ...] ) ); Prevents rows from violating a condition defined by operators. Example: CREATE TABLE circles ( c circle, EXCLUDE USING gist (c WITH &&) ); Or CREATE TABLE foo (x int, EXCLUDE (x WITH =3D)); --This is essentially like a UNIQUE constraint but defined via EXCLUDE. 2. In Window Function Calls (docs at [4]) We use EXCLUDE in the window frame exclusion clause. In SQL, when we use OVER (...) with ROWS or RANGE, we can also specify EXCLUDE to control which rows are considered in the window frame. Options explained: EXCLUDE CURRENT ROW =E2=86=92 exclude the current row from the frame. EXCLUDE GROUP =E2=86=92 excludes the current row and its ordering peers fro= m the frame. EXCLUDE TIES =E2=86=92 excludes any peers of the current row from the fram= e, but not the current row itself EXCLUDE NO OTHERS =E2=86=92 include everything (default). Example: SELECT id, value, SUM(value) OVER ( ORDER BY id ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE CURRENT ROW ) AS running_sum_excluding_current FROM test; ~~ IMO, we use EXCEPT in postgres when we want to filter a set of objects from all selected objects and we use EXCLUDE mostly in terms of rows based constraints/exclusion. And our example of : Create publication pub1 for all tables EXCEPT/EXCLUDE tab1,tab2; has more resemblance to: IMPORT FOREIGN SCHEMA public EXCEPT (audit_log) FROM SERVER remote_pg INTO remote_import; So based on above, +1 for EXCEPT for our case. ~~ [1]: https://www.postgresql.org/docs/current/queries-union.html [2]: https://www.postgresql.org/docs/current/sql-importforeignschema.html [3]: https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONST= RAINTS-EXCLUSION [4]: https://www.postgresql.org/docs/current/sql-expressions.html#SYNTAX-WI= NDOW-FUNCTIONS thanks Shveta