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

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: shveta malik <shveta(dot)malik(at)gmail(dot)com>
Cc: Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, Zhijie Hou <houzhijie22(at)gmail(dot)com>, 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-03 04:42:30
Message-ID: CAFiTN-vO9JwrsmKHQsqDS8TZJ5HY0pViR+zqyeKpH4Vhse7YGQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Dec 3, 2026 at 10:08 AM Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
>
> On Thu, Dec 3, 2026 at 9:56 AM shveta malik <shveta(dot)malik(at)gmail(dot)com> wrote:
> >
> > On Thu, Dec 3, 2026 at 9:42 AM Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
> > >
> > > On Thu, Dec 3, 2026 at 2:58 AM Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com> wrote:
> > > >
> > > > On Wed, 2 Dec 2026 at 18:59, vignesh C <vignesh21(at)gmail(dot)com> wrote:
> > > > > The attached v2 version patch has the changes for the same. This
> > > > > version also fixes Shveta's alignment issue from [1].
> > > > > [1] - https://www.postgresql.org/message-id/CAJpy0uB_%3Df6MCg9vU4f6QGeHq7JLbLdDKoGYgktXqqr9Ro29WQ%40mail.gmail.com
> > > > >
> > > >
> > > > Hi Vignesh,
> > > >
> > > > I reviewed the v2 patch and have a comment:
> > > > With patch dRs+ no longer honors '\pset numericlocale'. Suppose
> > > > subscription is created with 'max_retention_duration = 1000' and in
> > > > the psql session '\pset numericlocale' is executed.
> > > >
> > > > In HEAD, \dRsx+ display 'Max retention duration | 1,000'
> > > > but with patch, \dRs+ displays 'Max retention duration | 1000'
> > > >
> > > > In printQuery function we have:
> > > > ```
> > > > if (cont.aligns[c] == 'r' && opt->topt.numericLocale)
> > > > {
> > > > cell = format_numeric_locale(cell);
> > > > mustfree = true;
> > > > }
> > > > ```
> > > > Maybe in the patch we add a similar check in 'describeSubscriptions'?
> > > >
> > > One minor comment in V2
> > >
> > >
> > > - myopt.title = _("List of subscriptions");
> > > - myopt.translate_header = true;
> > > - myopt.translate_columns = translate_columns;
> > > - myopt.n_translate_columns = lengthof(translate_columns);
> > > + if (!verbose)
> > > + {
> > > + myopt.title = _("List of subscriptions");
> > > + myopt.translate_header = true;
> > > + myopt.translate_columns = translate_columns;
> > > + myopt.n_translate_columns = lengthof(translate_columns);
> > >
> > > - printQuery(res, &myopt, pset.queryFout, false, pset.logfile);
> > > + printQuery(res, &myopt, pset.queryFout, false, pset.logfile);
> > > +
> > > + PQclear(res);
> > > + return true;
> > > + }
> > >
> > > I see the usage of myopt is only inside the !verbose branch, so can we
> > > also move the declaration of the variable inside this branch?
> >
> > Same goes for 'translate_columns'; it should also be moved inside the
> > !verbose branch.
>
> +1, yeah I missed that.
>

Since we are on it we can completely get rid of the
translate_columns[] variable, see other places where we don't need any
field to be true e.g. describeTablespaces(), describeAccessMethods(),
describeAggregates() and many more where we don't this column at all,
in our case also we are setting all memebers false so we can get rid
of the translate_columns altogether?

--
Regards,
Dilip Kumar
Google

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Narayanan Venkateswaran 2026-12-03 04:54:51 Re: Fix LogStandbySnapshot() race during logical decoding activation
Previous Message Dilip Kumar 2026-12-03 04:38:02 Re: Show the conflict log table in \dRs+ output