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 1wgwCD-006VO2-29 for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Jul 2026 03:10:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wgwCC-0048GZ-1e for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Jul 2026 03:10:04 +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 1wgwCC-0048GR-0L for pgsql-hackers@lists.postgresql.org; Tue, 07 Jul 2026 03:10:04 +0000 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wgwCA-00000001wno-26m4 for pgsql-hackers@lists.postgresql.org; Tue, 07 Jul 2026 03:10:03 +0000 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-845ea8924fdso4086479b3a.0 for ; Mon, 06 Jul 2026 20:10:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1783393801; cv=none; d=google.com; s=arc-20260327; b=jlesX4SkUHOPfyzpHxuhhPNSDJEbklKL/RmYqSVZQVqMxdRFkmINa0unqfpuVQ6zyX zwPZMqmZwcbV315VxN44YSidUwc2BpvVcIYWUJlMquk6wM+ZG7PcB2ntijXOHmjOxdS1 d4u9/M+U+jHVWuHbgqD5AAhI1R6ms8vLGNMGKhlXMrJS3shxXcO3Vq1L0dGR1zCJ8Rox FU9VZKyb2isOiixf+B5XPuPu5/pwQhI5zfFddf1+Q6eKAy39SUvjtPAvHe1dTK6UOxXM 3mqL5WU0k13Xcz7D8V4Yb2SGCEqBGjokKwhmnMhC+Ncyr7WNTYi29WJEIIxUnHV6MD+x Ej3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ZeXh7+Wvy08FCmtu80o+IVrvV80rz5AnJYY4HAQ3os4=; fh=GimK79lpFwnja6ts3SVuQ3ytZc6z35c1Cj5JFe7DEP0=; b=eTzGZnCXpL2aZW1Lxd5axZS1w0GdzHsmlL3i833/wxLd3yNvWGj/8+TBTosnp83s7a HmyJ/DaJOQx6kEt0ANk3ttp1tjq07W/mY8B15YFnz65RtJUIh3+NHr1CFxcn4H2YvRSY j6khy0ME7WXnBLM5kTf3stzkhZFKRFYvqHm2nWU6uT2adNatoz6ISK1P5B7Qas8rUwJe pOdTyY8QM4BWE7CXi6dlqSFifDVB8b6ObVAYmtH7Mr8DteeZENiss7DsjwtB4QCKYxI/ /cUADN8+412Iwz6yCqGKQaiMDtek0Ahh5dIuskYyvGC3IKzMIB0r+h/5I4e9BFi/IcfD mI4A==; 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=1783393801; x=1783998601; 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=ZeXh7+Wvy08FCmtu80o+IVrvV80rz5AnJYY4HAQ3os4=; b=s6KP4UUqIO/krxtuqk0Ciwyjl4GNgLVWeu9USTXdVVdO9JpQFMar2/rSChv1UwoLDA trb5iu+5VKL9ogv+y+lLdIO6eYm4shy0WzM6AGjwS7teiSUy/jCxb7MiEZ851JWNVmqB G1F+rqLn8iGrLSbxNhXc4nKo5gKzk2m31PTnATpYOUrMJx6YqB/+/LMlm+sq8rcY6f6e 1+iguTchMDtlENaedr61gASD6z/aQeBx6bqb7K5o2fNhx/SgU6JYaqkIumCCIWgFPNYK ISK8cjiWmgj9jrmBizkhYik0Nlzinhx2ZByRd+CfYZDl6lYZjlBkQpVXpQtt2abGiE8j fVNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783393801; x=1783998601; 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=ZeXh7+Wvy08FCmtu80o+IVrvV80rz5AnJYY4HAQ3os4=; b=TzHlBn1eJwfTqX3Z99qvw5NYPpTwB8Iu0QVcEDc2f2Rd/jZqakUPJKij5AefMhEUrf uNpzFcChzR+hcp0s9maYcjawVE9XJWAEDfLOS7h4mUw2xcWb8l7Vo54mcIFV2bEDQ7ds E2ltkiVmLuf1VRxm4RvKwnWcNmvqfo92uuKOGsAFEZXfT55vW4BxMtyr8rcL7lrGNfk+ Jwcf21WNv3IlcQuLlmSHEbktQ7sr8ZEFISh8eUHweK4ll10/o/2/4kwpjuoQNGyGjLXi t6i/J9SuInKpb7hOPx4aPwwfvNBoAN/fLvoGJP1bny964ZAcKgGqHfasFRaiYfiTc7VB 2kgw== X-Forwarded-Encrypted: i=1; AHgh+Rpw5tP29bCKpIGSYxyMcvFaz7QWpZ3yX7m0l/MzIKAnu7jqtOEX+bS1KiF0BptdnnYypt4rev+DN+NDe1RK@lists.postgresql.org X-Gm-Message-State: AOJu0YwiY5g5f5Pn1jtVmOpiyZwUlR4y+T8cyzoexGopT/JiefaOxrWI vr+TQkyVGXVGvtMzM7sgQb9GokLbfXnEV4ovod7a90bVHYRNIUogTWBv6PdX0XYs9GMpMonS7zN 6DP2U2L2Gu0C2lMjmgRAiuzajdoKPW38= X-Gm-Gg: AfdE7cnuc8dFesQ0OLx4/ZMs3F7uOHwxiwnYWWQ/aIXCw3sM/3RsAN4YSuyb2Ilil7t WgwCt2Ov32v7CuEXEmYxXuGubWG/Rw0Q33FHGxA6HV2bDLLcBYSw+gfJwloQh/bfO1H5bzTLwaE FPBujR88DAYofXFBYzxRvDtX0jZfY6FZTBWvNfXhfW4Qx+RWFptiJUd86VMS0oTjUqRF1LGsdfz +MvDhHBK4/405bKcBSGIJ4BwzHKzdOJuuP4qCs6cPa1iyiJWCH8yMfdGACVh3HRbsb+ENhwJE94 c1F+QnD8TxIFKNGbPoMdcsXx4E67JqsG6uFmnCNlRh4= X-Received: by 2002:a05:6a00:3996:b0:845:4928:8655 with SMTP id d2e1a72fcca58-84826d1cc67mr3070285b3a.39.1783393801122; Mon, 06 Jul 2026 20:10:01 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: shveta malik Date: Tue, 7 Jul 2026 08:39:48 +0530 X-Gm-Features: AVVi8CdP6hT5e1mgrgagspKVCWxmHZRZRLk2lVvayJcupwg-16MjjDHDFHMI7Ts Message-ID: Subject: Re: Support EXCEPT for TABLES IN SCHEMA publications To: Peter Smith Cc: Nisha Moond , Amit Kapila , Zsolt Parragi , pgsql-hackers@lists.postgresql.org, 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 Tue, Jul 7, 2026 at 4:31=E2=80=AFAM Peter Smith = wrote: > > Hi Nisha. > > Bug: The current patch is allowing conflicting exclusion lists... > > =3D=3D=3D=3D=3D=3D > > Background: > > It's always been possible for CREATE PUBLICATION to specify the same > schema or same table multiple times. > > test_pub=3D# CREATE SCHEMA MYSCHEMA; > CREATE SCHEMA > test_pub=3D# CREATE TABLE T1(A INT); > CREATE TABLE > test_pub=3D# CREATE TABLE MYSCHEMA.T2(A INT); > CREATE TABLE > test_pub=3D# CREATE TABLE MYSCHEMA.T3(A INT); > CREATE TABLE > > // same table multiple times is OK > test_pub=3D# CREATE PUBLICATION PUB3 FOR TABLE T1,T1,T1,T1; > CREATE PUBLICATION > > // same schema multiple times is OK > test_pub=3D# CREATE PUBLICATION PUB1 FOR TABLES IN SCHEMA MYSCHEMA, > MYSCHEMA, MYSCHEMA; > CREATE PUBLICATION > > ~~~ > > But, this behaviour is only allowed if there are no specification > conflicts. e.g. You can't have multiple tables with column lists: > > test_pub=3D# CREATE PUBLICATION PUB4 FOR TABLE T1,T1(A),T1,T1; > ERROR: conflicting or redundant column lists for table "t1" > > =3D=3D=3D=3D=3D=3D > > Bug: > > IMO similar restrictions and a similar error message needs to happen > for clashing schema exclusions. Specifying the same schema multiple > times is fine, but it must be disallowed if there are conflicting > exclusion lists. > +1. Good Catch. > For example, the command below currently works, but it should not: > > test_pub=3D# CREATE PUBLICATION PUB2 FOR TABLES IN SCHEMA MYSCHEMA > EXCEPT (TABLE T2), MYSCHEMA EXCEPT (TABLE T3), MYSCHEMA; > CREATE PUBLICATION > > test_pub=3D# \dRp+ PUB2 > Publication pub2 > Owner | All tables | All sequences | Inserts | Updates | Deletes | > Truncates | Generated columns | Via root | Descri > ption > ----------+------------+---------------+---------+---------+---------+---= --------+-------------------+----------+------- > ------ > postgres | f | f | t | t | t | > t | none | f | > Tables from schemas: > "myschema" > Except tables: > "myschema.t2" > "myschema.t3" > > =3D=3D=3D=3D=3D=3D > Kind Regards, > Peter Smith. > Fujitsu Australia > >