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

From: shveta malik <shveta(dot)malik(at)gmail(dot)com>
To: vignesh C <vignesh21(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, shveta malik <shvetamalik(at)gmail(dot)com>
Subject: Re: Show the conflict log table in \dRs+ output
Date: 2026-12-02 09:32:08
Message-ID: CAJpy0uB_=f6MCg9vU4f6QGeHq7JLbLdDKoGYgktXqqr9Ro29WQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 2, 2026 at 2:50 PM shveta malik <shveta(dot)malik(at)gmail(dot)com> wrote:
>
> On Wed, Dec 2, 2026 at 12:16 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
> >
> > Hi,
> >
> > 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].
> >
> > This is the same patch as v97 at [2], except for one new test to
> > verify the CLT is included as a subscription footer.
> >
> > [1] https://www.postgresql.org/message-id/CAA4eK1KdKqKkaTqcj3in6ehD_hg6oOaCF_-JsVfd8N6nS8oV9g%40mail.gmail.com
> > [2] https://www.postgresql.org/message-id/1257417f-cc58-4039-b8a9-498ff361ebf1%40gmail.com
> >
>
> Thanks for the patch. A few initial comments:
>
> 1)
> The CLT name shown depends on search_path. If search_path does not
> include the pg_conflict schema, it shows:
>
> \dRs+
> ...
> Conflict log table:
> pg_conflict.pg_conflict_log_16402
>
> But if pg_conflict is added to search_path, it shows:
>
> \dRs+
> ...
> Conflict log table:
> pg_conflict_log_16402
>
> This is inconsistent with \dRp+, which always shows the schema name of
> the published tables, irrespective of search_path. Shall we build the
> name as n.nspname || '.' || c.relname (as \dRp+ does) instead of using
> subconflictlogrelid::regclass::text?
>
> 2)
> \dRs+ with no subscriptions now prints the error "Did not find any
> subscriptions.", whereas earlier it printed an empty table. That is
> okay, as it is now consistent with \dRp+. But the doc only says "an
> error is reported if no subscription matches the pattern", which IMO
> does not cover this case where we run it without a pattern. Let me
> know if I misunderstood this.
>

3)
Also I noticed one more thing: in subscription.out, the alignment of
"Max retention duration" has changed; earlier it was right-aligned,
now it is left-aligned. Is that intentional?
As far as I understand, printQuery() aligned each column by its type
using column_type_alignment(), which right-aligns numeric types such
as int4 (submaxretention), but this patch passes align = 'l' for all
columns.

thanks
Shveta

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message shveta malik 2026-12-02 09:35:41 Re: DOC: Minor updates for logical replication conflicts
Previous Message Zhijie Hou 2026-12-02 09:25:38 Re: Show the conflict log table in \dRs+ output