| From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
|---|---|
| To: | Álvaro Herrera <alvherre(at)kurilemu(dot)de> |
| Cc: | Roberto Mello <roberto(dot)mello(at)gmail(dot)com>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: pg_publication_tables: return NULL attnames when no column list is specified |
| Date: | 2026-03-31 22:55:48 |
| Message-ID: | CAKFQuwa8i+TFSfs_LVCVZpK2jXyjkD_giKPg1rt57AsXrgW=BA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Thursday, March 26, 2026, Álvaro Herrera <alvherre(at)kurilemu(dot)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. 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:
“Subscriptions having several publications in which the same table has
different sets of columns published are not supported.”
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
“set of columns actually seen”, makes sense seen in that light.
I haven’t dived deep enough to understand whether there is C code issue
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 “union all sets of columns published for a
table and replicate those” 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.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Melanie Plageman | 2026-03-31 22:55:54 | Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access) |
| Previous Message | surya poondla | 2026-03-31 22:26:06 | Re: Bug: mdunlinkfiletag unlinks mainfork seg.0 instead of indicated fork+segment |