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 1wXErJ-0039CO-20 for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Jun 2026 09:04:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wXEqG-00ADlg-32 for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Jun 2026 09:03:20 +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 1wXEqG-00ADlX-1h for pgsql-hackers@lists.postgresql.org; Wed, 10 Jun 2026 09:03:20 +0000 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wXEqE-00000001z0g-3dEh for pgsql-hackers@lists.postgresql.org; Wed, 10 Jun 2026 09:03:19 +0000 Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-5aa69131836so5807835e87.3 for ; Wed, 10 Jun 2026 02:03:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1781082197; cv=none; d=google.com; s=arc-20240605; b=ZopeB7Gq79W+/JB1iAeoL/07ORLbSMhR3FTllSO+0T03SCjz/g0KF4Et7eDtji4MiC PDAfh6xvvjboHfA8bl3KACksHQLi/uW19jo7PeH5TdM4sTWsfyG9UD5laPTTYehIZXh4 a1zmz7xY/0+ykcbJUadJku7BlwzhQEhhM0R1X2yYqgirSDF+B0X0cZo//FiypWRDM+3S wcUfEhOv9sFWEsMC/YqFyTGQwZqUuWGf1W6YvxyIotEdZ+iUvKGXr2sfKnJsGx1MGjIg QrD4JRJ5/Qb+Pndk9vb91UaIAwnGqvDLgAHytyQTqIKVf5p8e0mOClGwVUqMwyWgpFaW ePnA== 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=3jAZv4xMRANvFXEkP8GM1MHqepm6xvW4te8S2JUowrE=; fh=jA1y0o48KsEr1ncbKeaqgkONBUmAh+4Dc8UAqTSPpFs=; b=X1KOOps4jguH1sjGEvuieICGUjvTkzQXwwvhUyB/Kktqy7iYDspzadbal01XhQiY2a yvovRjxvW6I2MJQuTRBmAHECnl4inurjWtJqOz4P2rDVrcV3YyB64MCYlLu/CuIkFeRi 8Xr7BewRV6lcTMO+0V/L+1Qm1idYkVVQqaq2gHKZzylkPYAer4yvsgiNIkAM/G4kpDVt z9j6DsHNfdX83eyZRxs096NXTe43UCu2vahLqtcCbUSWWnzcD3Un6W5JfaaoSnX7RVg6 mwImXRLzYorPQsTzaZOdvhEztWSfgHRSJwYse2bpDZWugDajFm2IfdEB4Zsn2IcAZklP OYYQ==; 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=1781082197; x=1781686997; 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=3jAZv4xMRANvFXEkP8GM1MHqepm6xvW4te8S2JUowrE=; b=GU3CLR2hvsTaiSdYniZTInq92BOH8+ND2ZXJIGHcE9kkkyIXNGujaT4SvQlHZmC6zY gORBcziSgvBJNu061agA3TuRt5VpCLBjpFcxstfAzsLq4g8kgROt4s6/NlVJsGgizNhZ CGzk/zg2WokW6jI/0eoSSBRZePxyvDM5y8HLQxsglbvUWFWwJglxHuIZBMCXP0frvZ+Z +ggkT9+CJkbC8EpPtwigFlUM2f4SAnLeofa9BB3/ibbivGGUl0/0ftfD4hpMlIKU+A5S /V5K+likU00ETZH2WqgTPH2XF0k0MKX1gW1J7yVak3asuLbxFO2IBHU2FtP4qVv0KWsr j9Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781082197; x=1781686997; 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=3jAZv4xMRANvFXEkP8GM1MHqepm6xvW4te8S2JUowrE=; b=CawIQtNQLWMS+Cgtv8d2pAIQog4DYFFlh44wNxJlPGmtOuvVE2kEKhHS1/BOBuJvPy PnBphQFp1P1A91AiYO3I7KTEJcBIgIqCyf4LSxdpuu4H2C6iTOFodGobhWUTWtAXYdCZ VvAtc7b43CR/DPrHyDKpEjNUVfpvWBs9UX/PAmQ6ZF7UUONg+n5JQIDugrTZZEVNQVru N2A7T8f1hOcb2lVxSPl96/YiiLHItV6A165mDIsblSf7iF/majVzA5sdLhEmw2ArSfGM YFewtIZBgYitFYFYygt2qJVEJ/ftD1xjyIfAbTWj1fBLIm5EqekIxNTghdlq9vpTmKRm jjiA== X-Gm-Message-State: AOJu0YxB5C/i7r/vqXhDgZdvp4421NRtGP6cW0ONXZNAvf+9b5YqVrHu 62xZrOy9CQLlc3AYVP8UWb+xoKib/Tj53aCeqqmvUk1kkdwgGh6u29Lk7iOioKWeTgGZYKJLF60 NqiyNYVBQWARIPAXPSz0O675lDchdH5fRU1o= X-Gm-Gg: Acq92OHqwfdKswZL0Cz7Qg1EihHxsOzeB4MXqDTrwIF2laWTFa7gTtW/9s/eQbmqVz1 ZFaa4s5cc/d9g1J1ggBJ2QMJBbA13nXyXnR2uBcQphRw9sobDRpSrEGkWDmMzOaNjz8ctAWwQE4 jbRnfKLQqArvpqVtMe/CuATvCjcWmPVa/Q+XcGn/6gQbkVbk0Jr1/p+GJXQ8SYURuKcnU0Pr0kY uwbVcPnDfgd2du8rTWLrfs6UMffAJi7pYhL9JmpCKVLVQhnxg143HaAv8xm+0hipbRHhY0EmQAa FrivwlU6kwCTcxu1F3WoY00+D4/c/sTqoYaC9YJTRTMJ57q1Wg== X-Received: by 2002:ac2:51d4:0:b0:5a2:c4f1:2635 with SMTP id 2adb3069b0e04-5aa87befc37mr7050786e87.41.1781082196838; Wed, 10 Jun 2026 02:03:16 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Nisha Moond Date: Wed, 10 Jun 2026 14:33:04 +0530 X-Gm-Features: AVVi8Cd-IhDeFpJMjLZYc9ERDyPR9J64H0lUnh5-86b_OEB0ln_PMmCoKE2P1A0 Message-ID: Subject: Re: Support EXCEPT for TABLES IN SCHEMA publications To: Zsolt Parragi Cc: pgsql-hackers@lists.postgresql.org 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 Wed, Jun 10, 2026 at 3:06=E2=80=AFAM Zsolt Parragi wrote: > > > Do you mean other.t should be there? > > Yes, that was a typo in my example. > > > After considering, I chose to follow behavior similar to existing FOR > > ALL TABLES publications to handle schema-switch cases. Today, if a > > table excluded via EXCEPT is dropped, the corresponding prexcept entry > > is removed, and recreating a table with the same name does not > > automatically restore the exclusion. > > > > I applied the same principle to schema changes: once an excluded table > > moves out of the schema, the exclusion is removed. > > I'm not that sure about the analogy. DROP TABLE is a destructive > operation, executing DROP TABLE and then CREATE TABLE won't > automatically bring back the data. > > With this approach, two cheap ALTER TABLE ... SET SCHEMA statements > can clear an EXCEPT clause without the proper permissions. > We already have similar behavior today. A non-publication owner can run ALTER TABLE ... SET SCHEMA and remove a table from a FOR TABLES IN SCHEMA publication without any warning or publication-level permission check. > But I'm not sure what's the best solution for this. The v11 approach > is at least more consistent than the previous behavior. > > > 1) Reject the schema change: Error out if a table with a prexcept > > entry is moved between schemas. This feels overly restrictive. > > It is restrictive, but maybe it's the better solution? Or > alternatively, maybe it should require proper permissions to remove > the except clause? > My concern is that introducing a permission check only for the EXCEPT case would create an inconsistency: one type of schema move affecting publication behavior would require publication ownership, while another would not. That said, I'm okay with restricting schema changes for tables in an EXCEPT list if others feel that's the right behavior. Let's wait for feedback from others. > Another thing that could improve this if we would print out a warning > that the statement caused a change in the publication? But then that's > also a question for the preexisting drop table case. > Right, As also mentioned above, ALTER TABLE changes that affect publication membership currently do not emit any notice or warning, so I'm not sure we need one here either. -- Thanks, Nisha