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 1w7i03-005cGM-06 for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Mar 2026 22:55:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w7i00-00Dcsl-0e for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Mar 2026 22:55:52 +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 1w7hzz-00Dcsd-2W for pgsql-hackers@lists.postgresql.org; Tue, 31 Mar 2026 22:55:52 +0000 Received: from mail-oa1-x30.google.com ([2001:4860:4864:20::30]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w7hzx-000000022hs-44Rr for pgsql-hackers@lists.postgresql.org; Tue, 31 Mar 2026 22:55:51 +0000 Received: by mail-oa1-x30.google.com with SMTP id 586e51a60fabf-417c34b0509so4713736fac.1 for ; Tue, 31 Mar 2026 15:55:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774997749; cv=none; d=google.com; s=arc-20240605; b=O9prP7rTPVg5cB0yi7LCo4tJ05POS2lB8WLTc6cyh8pRTUAuCVSG2NFPG/FvRu32jv GDFwVZhHTpqItXXMzhk2+juPW/Pfq6ueEkbvkGYW3XiChbsCAkVlNzL+suQTuIJsef1J lSxMDuQr1Mp+Et9/mNdimVeO5eAE5BR3J2Ke7CrvUD+Wqhz7bKde8bUtSvW/t21yaxC2 A8uf1Wgy9sVV2urGh+S9wIBvAEZ24F2hkezyAvRwTmvMhwPj0WjiQftXIq+mso5hDQ8c Jaaj6FqX+J0SDw4enns7uWNSDEpIfW3j3kSxP24n3OTiDyKLo85tiSxUgKEntHRYlJy2 iY0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:dkim-signature; bh=8jVCKGd9EKppgab8ttiIie6FndOEkAvZZjSOFz1JY7Q=; fh=5aPvCYva39UaroGNZPkRswUj8EnS1dSnVCcnk9Iey84=; b=WqEheGp0GliiSAdG/Ue4EGt1RjvsBR3TWB5beEZssX/2JkJWU7USZzyLb9Po7gk2uP mT3KpGcok/eLtYYWED4zqePNPa/NUyUjDpqDOPsPvl82HSsUDPpswmEEYDW0P4ODZdTK 5bvLCBg7Fk+eQUisCr+CvhazROcxBzfANXBjiDnnFcKvxolGxuwkmPP8rlZ78ayGTFnY 7q6lqmfsqXakBzP/pO8d3mVIjfWu/qv4fScY43f4ubQhjSrjpqUZtXCTYrbOjPo/EaB1 ggiP3vNyr3j5lbgt2m/UrlTM9eQD10Z1KqZ/Y2mdm+fSfhht2CoQpqzx5PRaTLiOftTT xkEw==; 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=1774997749; x=1775602549; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=8jVCKGd9EKppgab8ttiIie6FndOEkAvZZjSOFz1JY7Q=; b=qDmv/zkYc+SzvkUCOXJaw87mnMC47DZrtYZbUjhIl9+MIL0vlo7zydCD0Hfthh+hKI rXrsp+w+B9AKbBvvbnZRZimrO3s4M7KWOaKgmU9TybWRi32geCp6r8ZEx/+W2A9TnvJF dKIvJHayd9BnuE9Nw2COequtjS5vFrV9VhhNuvVtBa9XVwELvucJZSYxuUFt0u+ZBSUb S/H/MYkJuBw/glDEdkoRr2jt3YweF79WuS1s13uFm7lMxINHwRcp7iX6E4g+qirF39jn OBTJZZrsEuc/HyaozEyvTLxqgtfEvzI9Y8nXn+f2MKE9vi9HwZtwxAxyruCQiF/CXXQ0 bM4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774997749; x=1775602549; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=8jVCKGd9EKppgab8ttiIie6FndOEkAvZZjSOFz1JY7Q=; b=B66QOLBFKD73OdffUlpCaeIbaCCFro6/dYI2dmwVwr88QmXgYzWNCfvmIGGVpv1KBU CnFifRZHlsC0y2BijjMLvczDS7JbSGWqgKt2TlL/zmndPnENMA9BE3nGpg8LQ5UpWWXV MVOYLIrFmMDi3zVJD/Oe3r2h7SgTow0Z9AB7ZkGtQP71JwdOK6G4652HnKHDuoX7aNyt LjTfzT9dwaBeqbKqR7kwUjo2bTDoQMxSeNeEb5BI7VaVkIvji0OwX0nUwM6Os2p2WicP fwSjZkmbtzIV+6GSgI/PJOaajrqOFG1wG4AZngaVm3qEwU2trJWCWjZBIJA8tVUNvjJ2 jAaQ== X-Forwarded-Encrypted: i=1; AJvYcCVFrK9vnPN3HjTy6jYYgR8VL0GfKBvPODaSvA8Ale1jmFDNHUnMzKlFxjyaoJjgdBLzhG/CewY6EhOW53Cb@lists.postgresql.org X-Gm-Message-State: AOJu0Yxf5Pm0wlp+rPWXOHIijl+vNfs8T4peW2uDUf7ytzn9HyqGM+Py 5KDyIu7QtKJDlEFN3C2FBmlis5REFyCSjjyAx8YCXQam4lfFgQcH/NxQy2y8oZChoMs2QZKxexX Q+pjJ0QrQKhTMAhQKWCs14iP4Jea2fH8mhg== X-Gm-Gg: ATEYQzwPJHD078Kpqx92Bx0gVcpjg7i2JNiM/V5B12Hw0Rafadck9gt2fFFm6uiBTZh lVH+/T6HVnW2Av55si1x6xB3KatGL1wifD/tjd4cbc0iQH7dgBV7/ETEIk8A/RxgS3cQf/5fsMa m4ABVg9yn82o1bA61ubM10uiXfPBCZZoZPldjClZE1X8owzMmFZ+vroeF4aCx+rhMV8KAjnb983 g227vz3I4HPOPjFWF6cLG5i0zcqlpLh98MVZcRfSqaj2aAhrkkv1XbJ6mkGDJsG3GaGTcN+Yl97 9XIr7H6OTqVtukieWhdkwC+/jOMftWta4GO22BTDSjbufkTt/Mg= X-Received: by 2002:a05:6871:7b05:b0:417:6419:609b with SMTP id 586e51a60fabf-422cff509c4mr960586fac.43.1774997749027; Tue, 31 Mar 2026 15:55:49 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:6802:6187:20b0:625:12ea:f6d8 with HTTP; Tue, 31 Mar 2026 15:55:48 -0700 (PDT) In-Reply-To: <202603261226.uo54xj4rpex2@alvherre.pgsql> References: <202603261226.uo54xj4rpex2@alvherre.pgsql> From: "David G. Johnston" Date: Tue, 31 Mar 2026 15:55:48 -0700 X-Gm-Features: AQROBzA84YPa0Rs9iUaC23wHyU4vFYO5xdLgZQC23UZggQ7z4Wy0dmlwHAXRGNY Message-ID: Subject: Re: pg_publication_tables: return NULL attnames when no column list is specified To: =?UTF-8?Q?=C3=81lvaro_Herrera?= Cc: Roberto Mello , PostgreSQL Developers Content-Type: multipart/alternative; boundary="0000000000004ed6b8064e59dea7" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000004ed6b8064e59dea7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thursday, March 26, 2026, =C3=81lvaro Herrera wro= te: > On 2026-Mar-25, Roberto Mello wrote: > > > The problem is that pg_get_publication_tables() in pg_publication.c > > (the set-returning function backing the pg_publication_tables view) > > erases this distinction. When prattrs is NULL, it opens the table, > > iterates all eligible attributes, and builds a synthetic int2vector of > > all current columns. The view then shows the same attnames output for > > both cases. > > I agree that this is wrong. This distinction was explicitly discussed > when the column-list feature was developed. I don't think we can > backpatch the fix though, out of fear that we would break something for > existing users; but we should definitely fix it for pg19. > IIUC the wording for v18 and earlier should read more like: =E2=80=9CSubscriptions having several publications in which the same table = has different sets of columns published are not supported.=E2=80=9D The claim that this defacto behavior is a bug needing to be fixed is now before us (there is no disagreement that the physical column lists are different - null vs non-null). My cursory take at this leads me to believe we should accept what actually got implemented and not call this a bug to be fixed (aside from the docs). That the catalog is the only official source of truth regarding the physical column list distinction, and the function represents the logical =E2=80=9Cset of columns actually seen=E2=80=9D, makes sense seen in that li= ght. I haven=E2=80=99t dived deep enough to understand whether there is C code i= ssue that needs to be resolved. Or whether we can make dealing with this more user-friendly given this constraint. Removing the limitation would seem more appealing if we are going to make a change. The obvious answer of =E2=80=9Cunion all sets of columns published= for a table and replicate those=E2=80=9D would be the simplest to document though= I suspect the current implementation basically chooses one of the publications to pull from which makes that difficult in the general case. I do kinda wonder why we need to enforce any kind of error so long as one of the publications for a given table includes all columns though. Or even is a proper superset to be a tiny bit more flexible. A technically uninformed wondering but still. David J. --0000000000004ed6b8064e59dea7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thursday, March 26, 2026, =C3=81lvaro Herrera <alvherre@kurilemu.de> wrote:
On 2026-Mar-25, Roberto Mello wrote:

> The problem is that pg_get_publication_tables() in pg_publication.c > (the set-returning function backing the pg_publication_tables view) > erases this distinction.=C2=A0 When prattrs is NULL, it opens the tabl= e,
> iterates all eligible attributes, and builds a synthetic int2vector of=
> all current columns. The view then shows the same attnames output for<= br> > both cases.

I agree that this is wrong.=C2=A0 This distinction was explicitly discussed=
when the column-list feature was developed.=C2=A0 I don't think we can<= br> backpatch the fix though, out of fear that we would break something for
existing users; but we should definitely fix it for pg19.

IIUC the wording for v18 and earlier shoul= d read more like:

=E2=80=9CSubscriptions having= several publications in which the same table has different sets of columns= published are not supported.=E2=80=9D

<= /div>
The claim that this defacto behavior is a bug needing to be fixed is n= ow before us (there is no disagreement that the physical column lists are d= ifferent - null vs non-null).=C2=A0 My cursory take at this leads me to bel= ieve we should accept what actually got implemented and not call this a bug= to be fixed (aside from the docs).

That the catalog is the only official source of truth regarding the phy= sical column list distinction, and the function represents the logical =E2= =80=9Cset of columns actually seen=E2=80=9D, makes sense seen in that light= .

I haven=E2=80=99t dived deep = enough to understand whether there is C code issue that needs to be resolve= d.=C2=A0 Or whether we can make dealing with this more user-friendly given = this constraint.

Removing the li= mitation would seem more appealing if we are going to make a change.=C2=A0 = The obvious answer of =E2=80=9Cunion all sets of columns published for a ta= ble and replicate those=E2=80=9D would be the simplest to document though I= suspect the current implementation basically chooses one of the publicatio= ns to pull from which makes that difficult in the general case.=C2=A0 I do = kinda wonder why we need to enforce any kind of error so long as one of the= publications for a given table includes all columns though.=C2=A0 Or even = is a proper superset to be a tiny bit more flexible.=C2=A0 A technically un= informed wondering but still.

Da= vid J.


--0000000000004ed6b8064e59dea7--