Re: Show the conflict log table in \dRs+ output

From: Peter Smith <smithpb2250(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Show the conflict log table in \dRs+ output
Date: 2026-12-04 03:20:09
Message-ID: CAHut+Pshe3y5GfW1nV4F4iWAT7gSwH_rcLJEYKeyGcPO+Af-aQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Dec 4, 2026 at 12:49 PM Peter Smith <smithpb2250(at)gmail(dot)com> wrote:
>
> On Thu, Dec 3, 2026 at 9:55 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> >
> > On Wed, Dec 2, 2026 at 12:16 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
> > >
> > > Attached is a patch that makes \dRs+ show the conflict log table of a
> > > subscription as a footer, when conflict_log_destination is set to
> > > table or all. The name is displayed because the conflict log table is
> > > a relation that users query directly for diagnostic purposes, making
> > > it useful to have its name readily visible. It is displayed as a
> > > footer, following the style of existing \dRp+ footers (for example,
> > > "Tables from schemas:"). To accommodate this, \dRs+ now displays each
> > > subscription in a separate table, with the subscription name as its
> > > title. The output of \dRs without + remains unchanged. The footer is
> > > titled "Conflict log table:". This approach follows the discussion at
> > > [1].
> > >
> >
> > I see the discussion you linked but now again thinking about it, I
> > feel we should consider displaying it as another column in the \dRs+
> > output. The footer format for dRp+ is required for publications as
> > there could be a list of tables to display. OTOH, here we will always
> > have a single table and that too when users choose to
> > conflict_log_destination as 'table' or 'all' neither of which is
> > default.
> >
>
> Yes, a column is OK in lieue of a footer. Already, psql treats the
> same kind of property differently in a list and in a single-object
> display: e.g. for tables, "Access method" is a column in the "\d+"
> list but a footer for "\d+ t1" (where a pattern is given).
>
> Since the CLT name only has a value when the destination is 'table' or
> 'all' (neither is the default), one idea might be to fold it into the
> existing destination column instead of adding another mostly-empty
> column:
>
> Conflict log destination
> -----------------------------------------
> log
> table (pg_conflict.pg_conflict_log_16406)
> all (pg_conflict.pg_conflict_log_16406)
>
> ~~
>
> Separately, \dRs+ (this patch) and \dRp+ don't follow the \d+
> convention for footers (for tables they appear only when a pattern is
> given). I feel that perhaps they should do but that is a bigger
> debate. I'm planning to start another thread for that.
>

Hi Vignesh,

To be clear about my earlier comment: I would prefer that this patch
does not introduce a footer. Keeping \dRs+ a list (with the conflict
log table shown in a column, or folded into the existing destination
column) keeps the change small, avoids splitting
describeSubscriptions() into list and describe variants.

As Amit noted, the \dRp+ footer exists because a publication can have
many tables, which does not apply here.

The broader question of whether \dRp+ should follow the \d+ convention
(footers only when a pattern is given) is separate from this thread,
and anyway behaving same as \d is maybe less important than I had
thought because I've since found some other describes are also
different.

Kind Regards,
Peter Smith
Fujitsu Australia

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message shihao zhong 2026-12-04 03:43:55 Re: DROP USER MAPPING doesn't acquire lock on its server
Previous Message Michael Paquier 2026-12-04 03:16:51 Re: pg_receivewal doesn't truncate compressed WAL files on restart