Re: Psql meta-command conninfo+ - Mailing list pgsql-hackers

From Dagfinn Ilmari Mannsåker
Subject Re: Psql meta-command conninfo+
Date
Msg-id 87mse828bv.fsf@wibble.ilmari.org
Whole thread Raw
In response to Re: Psql meta-command conninfo+  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-hackers
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:

> On 2025-Feb-22, Alvaro Herrera wrote:
>
>> Also, there's a bunch of "(char *)" casts that are 100% due to
>> printTableAddCell() taking a char * instead of const char * for the cell
>> value.  That seems a bit silly, we should change that.
>
> Ah, but the problem is that most of the input cells there come from
> PQgetValue which returns a char *, so we'd need different casts
> elsewhere.  Nevermind this ...

Also, it calls mbvalidate(cell, ...), which can modify the contents
(stripping out invalid characters), so we'd better hope all the possible
PQsslAttribute() values are valid UTF-8 or we've got possible UB on our
hands.

- ilmari



pgsql-hackers by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: Removing unneeded self joins
Next
From: Jakub Wartak
Date:
Subject: Re: Draft for basic NUMA observability