| От | Tom Lane |
|---|---|
| Тема | Re: [HACKERS] elog vs errmsg_internal |
| Дата | |
| Msg-id | 16689.1501793786@sss.pgh.pa.us обсуждение |
| Ответ на | [HACKERS] elog vs errmsg_internal (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>) |
| Список | pgsql-hackers |
Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> Is there a preferred method to select between using elog() and
> errmsg_internal()?
ereport(... errmsg_internal() ...) can be a win for debug messages that
are in hot code paths, because the test for whether the message will
get printed is able to short-circuit more work. In particular,
if you have moderately expensive functions like syscache lookups in
the argument list of elog(), I believe those functions get evaluated
even if we end up not printing anything. ereport() skips the
arg-list evaluation in such cases.
But if that doesn't seem very relevant, I'd tend to go for elog()
just because it's less typing.
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера