Re: xmlserialize bug - extra empty row at the end

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: xmlserialize bug - extra empty row at the end
Дата
Msg-id 76417.1682299083@sss.pgh.pa.us
обсуждение исходный текст
Ответ на xmlserialize bug - extra empty row at the end  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
Jim Jones <jim.jones@uni-muenster.de> writes:
> If we agree to remove it, the change wouldn't be substantial :) I guess 
> we could just pchomp it in the end of the function, as suggested by Tom. 
> Attached a draft patch.

I wouldn't actually *use* pchomp here, because that induces an unnecessary
copy of the result string.  I had in mind more like copying pchomp's code
to count up the trailing newline(s) and then pass a corrected length
to cstring_to_text_with_len.

You could simplify matters by doing that in all cases, too.  It should
never find anything to remove in the non-indented case, but the check
should be of negligible cost in context.

            regards, tom lane



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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: buffer refcount leak in foreign batch insert code
Следующее
От: Alexander Korotkov
Дата:
Сообщение: Re: duplicate function declaration in multirangetypes_selfuncs.c