| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера