Re: [Feature request] Add a way to get the length of a PQerrorMessage in libpq - Mailing list pgsql-hackers

From Benoît Dufour
Subject Re: [Feature request] Add a way to get the length of a PQerrorMessage in libpq
Date
Msg-id f65f5e29-0e66-48a0-b582-3955815f3489@mail.com
Whole thread Raw
In response to Re: [Feature request] Add a way to get the length of a PQerrorMessage in libpq  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [Feature request] Add a way to get the length of a PQerrorMessage in libpq
List pgsql-hackers
It recalculates the strlen of the error message.

This is a bad behaviour for softwares that need to execute quickly.

The length of the error message should just be stored in a size_t
variable while the error message is generated instead and not recalculated.

Le 14/08/2025 à 11:53, Tom Lane a écrit :
> =?UTF-8?Q?Beno=C3=AEt_Dufour?= <benoit.dufour@mail.com> writes:
>> Could you add a way to get the size of an error message in libpq?
> What's wrong with applying strlen() to the result of PQerrorMessage?
>
>             regards, tom lane



pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Make pgoutput documentation easier to find
Next
From: Tom Lane
Date:
Subject: Re: [Feature request] Add a way to get the length of a PQerrorMessage in libpq