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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [Feature request] Add a way to get the length of a PQerrorMessage in libpq
Дата
Msg-id 204959.1755188673@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [Feature request] Add a way to get the length of a PQerrorMessage in libpq  (Benoît Dufour <benoit.dufour@mail.com>)
Список pgsql-hackers
=?UTF-8?Q?Beno=C3=AEt_Dufour?= <benoit.dufour@mail.com> writes:
> It recalculates the strlen of the error message.
> This is a bad behaviour for softwares that need to execute quickly.

If you're concerned about the cost of a strlen() in an error-handling
path, you've got your priorities wrong.  Not having gotten an error
in the first place is always going to be preferable.  Moreover, the
cost of that strlen() is utterly negligible in comparison to the work
the server did to detect and report the error (to say nothing of
possible network transmission costs).

            regards, tom lane



В списке pgsql-hackers по дате отправления: