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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Benoît Dufour <benoit(dot)dufour(at)mail(dot)com>
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 15:53:56
Message-ID: 189125.1755186836@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

=?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 Greg Burd 2025-08-14 15:58:26 Re: [PATCH] bms_prev_member() can read beyond the end of the array of allocated words
Previous Message Tom Lane 2025-08-14 15:52:49 Re: [PATCH] bms_prev_member() can read beyond the end of the array of allocated words