Re: [PATCH] Add pretty-printed XML output option

Поиск
Список
Период
Сортировка
От Jim Jones
Тема Re: [PATCH] Add pretty-printed XML output option
Дата
Msg-id 29ec1b21-1113-403c-bd00-b5009d9c4fdb@uni-muenster.de
обсуждение исходный текст
Ответ на [PATCH] Add pretty-printed XML output option  (Jim Jones <jim.jones@uni-muenster.de>)
Ответы Re: [PATCH] Add pretty-printed XML output option
Список pgsql-hackers
On 22.05.25 01:48, Tom Lane wrote:
> I did look at that one too.  I think it's fine, because we're
> dealing with a newly-created document which can't have a root node
> yet.  (Reinforcing this, Valgrind sees no leaks after applying
> my patch.)  I considered adding an assertion that that call returns
> NULL, but concluded that it wasn't worth the notational hassle.
> I'm not strongly set on that conclusion, though, if you think
> differently.


I see. In that case I believe that at least a different comment
explaining this decision would avoid confusion. Something like

/*
 * This attaches root to doc, so we do not need to free it separately.
 * The return value of xmlDocSetRootElement (xmlNodePtr) is intentionally
 * ignored here, as it is guaranteed to be NULL in this specific context.
 * When using this function elsewhere, ensure to handle the return value
 * properly.
 */


Best regards, Jim





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