Re: psql: Add leakproof field to \dAo+ meta-command results

From: Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>
To: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Cc: Erik Wienhold <ewie(at)ewie(dot)name>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: psql: Add leakproof field to \dAo+ meta-command results
Date: 2025-01-14 08:44:08
Message-ID: 20250114174408.0d85cc1fcc48b9385913d2da@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 10 Jan 2025 11:31:39 +0000
Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> wrote:

> On Wed, 4 Dec 2024 at 11:21, Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp> wrote:
> >
> > > Looking through the complete list of psql meta-commands, "leakproof"
> > > could plausibly be added to the output of each of the following:
> > >
> > > \dAo+
> > > \dC+
> > > \df+
> > > \do+
> >
> > I've attached a updated patch (v3-0001) that include changes on all
> > of these meta-commands.
> >
>
> Nice. I think this is very useful.
>
> I spotted one issue, which can be seen by compiling with --enable-nls
> and --enable-cassert. In that case \dC+ fails with an assertion error:
>
> \dC+ json
> psql: print.c:3564: printQuery: Assertion `opt->translate_columns ==
> ((void *)0) || opt->n_translate_columns >= cont.ncolumns' failed.
> Aborted (core dumped)
>
> This is because translate_columns[] in listCasts() needs to be updated.
>
> Similarly, in describeFunctions(), translate_columns_pre_96[] needs to
> be updated to support connecting to pre-9.6 servers.
>
> The translate_columns entries for this new column should be true, so
> that the "yes"/"no" gets appropriately translated. That means that
> describeOperators() will need a similar translate_columns array.

Thank you for pointing out this.
I've attached a updated patch v4 that includes fixes on translate_columns[]
and ranslate_columns_pre_96[].

Regards,
Yugo Nagata

--
Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>

Attachment Content-Type Size
v4-0002-Doc-replace-leak-proof-in-documents-and-comments-.patch text/x-diff 5.5 KB
v4-0001-psql-Add-leakproof-field-to-df-do-dAo-and-dC-meta.patch text/x-diff 20.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Anthonin Bonnefoy 2025-01-14 08:49:02 Re: Add Pipelining support in psql
Previous Message Pavel Stehule 2025-01-14 08:14:34 Re: XMLDocument (SQL/XML X030)