Re: [Feature request] Add a way to get the length of a PQerrorMessage in libpq

From: Benoît Dufour <benoit(dot)dufour(at)mail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [Feature request] Add a way to get the length of a PQerrorMessage in libpq
Date: 2025-08-14 16:14:17
Message-ID: f65f5e29-0e66-48a0-b582-3955815f3489@mail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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(dot)dufour(at)mail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-08-14 16:24:33 Re: [Feature request] Add a way to get the length of a PQerrorMessage in libpq
Previous Message Fujii Masao 2025-08-14 16:10:58 Re: Make pgoutput documentation easier to find