Re: Dependency to logging in jsonapi.c
| От | Tom Lane |
|---|---|
| Тема | Re: Dependency to logging in jsonapi.c |
| Дата | |
| Msg-id | 605718.1625065392@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Dependency to logging in jsonapi.c (Michael Paquier <michael@paquier.xyz>) |
| Ответы |
Re: Dependency to logging in jsonapi.c
|
| Список | pgsql-hackers |
Michael Paquier <michael@paquier.xyz> writes:
> Attached is a suggestion of patch to rework that a bit. Some extra
> elog()s could be added for the backend, as well as a new error code to
> use as default of report_parse_error(), but that does not seem to gain
> much. And this item looks independent of switching this code to use
> pqexpbuffer.h to be more portable with issues like OOM problems.
> Thoughts?
+1 in general, but I think I'd replace the one in report_parse_error
with "Assert(false)", rather than just dropping it.
It does not look to me like json_errdetail can sensibly be used in
frontend, since it returns palloc'd strings in some paths and
constants in others. There'd be no way to avoid a memory leak
in a frontend usage. So I think the dependency on psprintf there
is not really a problem, but maybe we should make the entire function
"#ifndef FRONTEND" to clarify the intended usage and avoid building
useless code into clients.
regards, tom lane
В списке pgsql-hackers по дате отправления: