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

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>
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-10 11:31:39
Message-ID: CAEZATCX69piV5zDTj3+64Y2Z=mctT0mnbzPJEiPSM=bGG-uFUg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

Regards,
Dean

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hayato Kuroda (Fujitsu) 2025-01-10 11:42:54 RE: Conflict detection for update_deleted in logical replication
Previous Message Amit Langote 2025-01-10 11:22:41 Re: Some ExecSeqScan optimizations