Re: Output of query_to_xml

Поиск
Список
Период
Сортировка
От Dickson S. Guedes
Тема Re: Output of query_to_xml
Дата
Msg-id CAHHcreqSb=rx9pKCfc5vKL1eD4PU7-3_qEcfiANT4p_2=aSTjQ@mail.gmail.com
обсуждение исходный текст
Ответ на Output of query_to_xml  ("P. Broennimann" <peter.broennimann@gmail.com>)
Список pgsql-general
2012/6/21 P. Broennimann <peter.broennimann@gmail.com>:
> Hi there
>
> In my stored function I use:
>
> select query_to_xml('select * from table12', true, true, '') into ...
>
>
> The result is OK but there is always an empty line:
>
> <row xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>                                 <-- Empty line here
>  <vanoao>FG8976SDFRETG</vanoao>
>  <country_code>NL</country_code>
>  <build_date>2011-02-28</build_date>
>  <tcode>MFT</tcode>
>  <exterior_color_code>GAB</exterior_color_code>
>  <interior_color_code>TAFP</interior_color_code>
> </row>
>
> Is this supposed to be or is this a cosmetic bug?

In fact this is in code [1], obviously, but if it should be there I don't know.

That extra line only is printed when 'tableforest' is set to true, so
if you use:

   select query_to_xml('select * from table12', true, false, '')

the extra line and the 'xmlns:xsi=' for <row> tag goes always.


[1]
http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/utils/adt/xml.c;h=44d327d7606df620c01b6e6532e53a9ee7a21f23;hb=HEAD#l2386

regards
--
Dickson S. Guedes
mail/xmpp: guedes@guedesoft.net - skype: guediz
http://guedesoft.net - http://www.postgresql.org.br

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

Предыдущее
От: Evan Martin
Дата:
Сообщение: Re: Please make it easy to drop a database that is in use
Следующее
От: "Marc Watson"
Дата:
Сообщение: Re: 32-bit libpq with 64-bit server