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 1wUKvN-0015jr-12 for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Jun 2026 08:56:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wUKvL-00DgXx-09 for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Jun 2026 08:56:35 +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 1wUKvK-00DgXp-21 for pgsql-hackers@lists.postgresql.org; Tue, 02 Jun 2026 08:56:34 +0000 Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wUKvI-00000000ico-2Lnw for pgsql-hackers@lists.postgresql.org; Tue, 02 Jun 2026 08:56:33 +0000 Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-39677242021so23638841fa.1 for ; Tue, 02 Jun 2026 01:56:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1780390591; cv=none; d=google.com; s=arc-20240605; b=QIT7o7JA3dqJirW8szDEESqvjg+jyUEIGBAPoKRrI5G97hySSsKssl64jAio4T5xL3 DS4byoiFLjtDGda0DMIvUV/YJUcCp619h3G23DC1i+7H1GJWDxSSWXISNKsCF59C89VX wj/zLJxx/VBzx1RH4sAhnvU5ZZ61d91uUDSUqdhMEwiKluYm8Gw/YQEXGXxHsdiZDTtp IipNoMxgQl+zK5Jm5+hyg968yO5QXNZCYZd4Vwmf4XKjUyRcfOzZ+MWZdvU/iCU21ceT wlVDKkXqL/IIA3tNAOBtaRqs5yBpF+As55ZWeu8j/TfahNvKWil2rXiesoku+Edp4C5x eeFg== 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=cmlBikLKZCgixDZXqkRl9H/dkFLJUuY+qkFbD2LkFmo=; fh=RMiU1PZM6/+KOp+uWri22cMgXUsmMsCdfA4rs3aZ2n8=; b=Y/PTXwHVQxHL4ndOTn8fLsQofeXxdxD78+9m/Z/apUZYwvo0JZx9T2oTPZHVGwZBKl JlY3IRPstowGQrxfruKpsoYxXhiqKXRg7gzQLrp3m7l8znZf/omVeRkhxsalta/SLSJL +9scLuQF205YyVa4VrvSQ8GWXAmFIns53d92QVxw/rTSbl6USDSK4G/ouzTixQK1EZkH kyVgfUkKjEfHsKINE4u1dKzSjQE0BDl7N9VG1GY7hWTtY+zmnTz09a16A+gEu0R/VH29 NgN8n2qs14dKmvKWgUyfkXy0o0QrEPPgc9y2CO6YuP/0UUbErE1DnTMwq8zJld/woHE4 x0Ig==; 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=1780390591; x=1780995391; 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=cmlBikLKZCgixDZXqkRl9H/dkFLJUuY+qkFbD2LkFmo=; b=QuL1zu7MYnyQQfegEFfRYLhy6hK67/kDNnMKx+hTTg/6o9/XhFKxmoKlW2HTJAK2jv /Y6NAmFdcTRYDoWXJGCxAFjFXutdEm6Eb9/YsX0OnP3KMZaLp7JNOzT1SzPaPi0eFT8t xsVTcjNiyAhOKctrfh+Y4lt8ck9VLBhyZclaecfYGLRsb5KbW70+j9/QEwaSGDZg304I 3wjOI34+rSz5mPK3f8IGhsbnPh9FfpH05EFH0oMqy1L74zBWcg2xyHyo9cV3Ki/95H66 c3KpuuYKVOOoSLgY7QzFfxWOoPmKWwYoWVDkM6HYwfw19055eTklivRsUQo3zKyvjbzp +mxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780390591; x=1780995391; 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=cmlBikLKZCgixDZXqkRl9H/dkFLJUuY+qkFbD2LkFmo=; b=RvzDtYXkMxKD0A3gmsGUUWo78ahqVuJCUTmnJZJgIihBYP+RiVmD31ydVKnSDlpjfU tEYvMBoZrUjHxnRqf13pYqxHvbdQWj3YU7QmtDwcMckOCKWQCehcp7ooNu0KqD6Kvltb j04ANClXiMMjAs7E28EQUtbNK/UEF40lN2jONFAyHdvj6m41cl87fQs3Q+EAcjieJh6W OTFJqLcO/lkFQSS2Z9LWxKb5Px+CCZrwVJKRQjKByGVQeYsKUKnYWuNuJpVm25yBKZq6 JUzsdgU7FVtRZOrz4uuUCcDoZ23v5ca9cPnyniOgGReQ6cSdU2LkPFHFqwnZhrJfKDIk bt+A== X-Forwarded-Encrypted: i=1; AFNElJ8LN9fx/UzZUbFFQK1EGL3cZQ2Dm0LoWiyLdP1AJeOltnBBbNIB9LKqDxMl0oaGfTlobmhOBP9AQ9fEMltz@lists.postgresql.org X-Gm-Message-State: AOJu0YwunjmHdZv9uHlPM+T81khCKLVZVlUx/UCXRBZkqNb0X4sJAxT4 pufVQmvrOgKSy7HnbWfuVJE5R3KeJEPdKa/YhwGRdFEUXegOEIObZaxoahec2BylGrMcTA8xyFC rsOk0uscbr2XmYGVuM0BeJDp9h4wg0mqtJkO7lQ== X-Gm-Gg: Acq92OEmn/nOaBTGDbGthpbL4KnWEKV3tbfU+YtZw+VzW4v01Cxg5PqFivvIxmWp7eg VJ78baKoE+3cG9zYMBKz9dbYg3siwHDjSCT1LWP6tog4PcVYepB3deB5Soq4TO+INVlXC81/6pz VzSaAdV2S85KIFyha1zH6Np+v2uvtknuy++O1fcgmb8bH1jzV8xRS/WH74xN4sp9aK65Oy2bo0e YuBtwDx0X7XBduWOmOOqZe8B/1nDzC/WxmWHt+Ln+fB5nt4pA36fFoHwnw7u2rptkGRyDOiuhFv ZFOe8VTw3TzFRVu2eeg7q3mHARNkagle5jNzE4iQavCzgQlT X-Received: by 2002:a2e:9e0f:0:b0:393:5ada:4605 with SMTP id 38308e7fff4ca-39664fed972mr33365851fa.25.1780390590593; Tue, 02 Jun 2026 01:56:30 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Nisha Moond Date: Tue, 2 Jun 2026 14:26:18 +0530 X-Gm-Features: AVHnY4IkX7ZyTtho3XXPif4Bzu5bJQDNJH0GsKUT6N579fBthL0wgs9ksQEGnxw Message-ID: Subject: Re: Support EXCEPT for TABLES IN SCHEMA publications To: Peter Smith Cc: shveta malik , Amit Kapila , 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 Mon, Jun 1, 2026 at 12:54=E2=80=AFPM Peter Smith = wrote: > > Hi Nisha. > > Review comments for v8-0001 and v8-0002. > Thanks for the review. > =3D=3D=3D=3D=3D=3D > git apply gives warnings. > > 1. > git apply ../patches_misc/v8-0001-Support-EXCEPT-clause-for-schema-level-= publicatio.patch > ../patches_misc/v8-0001-Support-EXCEPT-clause-for-schema-level-publicatio= .patch:176: > space before tab in indent. > errmsg("relation \"%s\" is > already member of publication \"%s\"", > warning: 1 line adds whitespace errors. > > =3D=3D=3D=3D=3D=3D > src/bin/psql/tab-complete.in.c > > On Sat, May 30, 2026 at 2:32=E2=80=AFPM Nisha Moond wrote: > > > ... > > > 9. > > > BTW, the current code is not able to handle multiple schemas. > > > > > > So, this works: > > > test_pub=3D# CREATE PUBLICATION pub1 for TABLES IN SCHEMA myschema > > > EXCEPT ( TABLE WITH ( > > > > > > but, this doesn't do anything: > > > test_pub=3D# CREATE PUBLICATION pub1 for TABLES IN SCHEMA public, mys= chema > > > > > > > I think the above preserves the existing behavior. Currently, we do > > not suggest "WITH (" after the second schema onwards. To support this > > properly, we would also need to handle "WITH (" suggestions for > > subsequent schema entries. > > > > I=E2=80=99ve created a top-up patch (patch-002) for this. I can merge i= t if we > > want to change the current behavior. Let me know your thoughts. > > 2. > Some scenarios are improved, but others do not work (either newly > broken or maybe they have been?). > I tested these scenarios on HEAD (without this patch), and most of them already exist today. (See inline below). > TBH, I am unsure if the added complexity of patch 0002 was worth it. I > am going to pass on this for now and wait for other opinions. > > e.g. > > Good: (suggests schemas to use) > test_pub=3D# CREATE PUBLICATION pub1 FOR TABLES IN SCHEMA > CURRENT_SCHEMA information_schema myschema public > Not introduced by this patch; it is existing behavior. > Bad: (does not suggest more schema to use) > test_pub=3D# CREATE PUBLICATION pub1 FOR TABLES IN SCHEMA public, > Not introduced by this patch; it is existing behavior. > Good: (completes names of known schema) > test_pub=3D# CREATE PUBLICATION pub1 FOR TABLES IN SCHEMA my > becomes > test_pub=3D# CREATE PUBLICATION pub1 FOR TABLES IN SCHEMA myschema > Not introduced by this patch; it is existing behavior. > Bad: (does not complete names of known schema) > test_pub=3D# CREATE PUBLICATION pub1 FOR TABLES IN SCHEMA public, my > Not introduced by this patch; it is existing behavior. > Good: (suggest EXCEPT with single schema) > test_pub=3D# CREATE PUBLICATION pub1 FOR TABLES IN SCHEMA myschema > EXCEPT ( TABLE WITH ( > This behavior is introduced by v8-0001. > Good: (suggest EXCEPT with multi schema) > test_pub=3D# CREATE PUBLICATION pub1 for TABLES IN SCHEMA public, myschem= a > EXCEPT ( TABLE WITH ( > This behavior is introduced by v8-0002. > Bad: (doesn't work if the FOR TABLE precedes TABLES IN SCHEMA) > test_pub=3D# CREATE PUBLICATION pub1 FOR TABLE mytab, TABLES IN Not introduced by this patch; it is existing behavior. ~~~ All of the above behavior is consistent with HEAD. Only the "EXCEPT (TABLE" suggestions are introduced by patches 0001 and 0002. I'm also not sure the added complexity is justified just for the "EXCEPT (TABLE" suggestion, especially since suggestions after commas are generally not supported in most existing cases. I'll drop patch-0002 for now and we can revisit it later if others have opinions on it. -- Thanks, Nisha