{xml}

Started by Ramesh Tover 11 years ago2 messagesgeneral
Jump to latest
#1Ramesh T
rameshparnanditech@gmail.com

Hello,
when i ran following query on postgres 9.3,
SELECT xmlagg(xmlelement(name e,part_id||',')) from part;

result
..................
{xml}

how to get part_id's..? please let me know ..
advance thanks,
R..

#2David G. Johnston
david.g.johnston@gmail.com
In reply to: Ramesh T (#1)
Re: {xml}

Ramesh T wrote

Hello,
when i ran following query on postgres 9.3,
SELECT xmlagg(xmlelement(name e,part_id||',')) from part;

result
..................
{xml}

how to get part_id's..? please let me know ..
advance thanks,
R..

Are you using psql? What version of PostgreSQL?

I am guessing "{xml}" is the client's way of saying that what you have is
"XML". Try casting the final result to "text" and see what you get.

Otherwise...

version
PostgreSQL 9.3.4 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu/Linaro
4.6.3-1ubuntu5) 4.6.3, 64-bit

Since this:

WITH vals (ids) AS (
VALUES ('1'),('2')
)
SELECT xmlagg(xmlelement(name "tag", ids))::text FROM vals;

works probably need to provide a self-contained example for someone to look
at.

--
View this message in context: http://postgresql.1045698.n5.nabble.com/xml-tp5814076p5814126.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general