Thread: postgres and xml

postgres and xml

From
Hrishikesh Deshmukh
Date:
Hi All,

Is there a way that makes it possible to export sql query results as a xml file?
I use postgres 7.4.7 on a debian system. Do i need any packages to
export query results as a xml file if its possible?

Thank you
Hrishi

Re: postgres and xml

From
Bruce Momjian
Date:
Hrishikesh Deshmukh wrote:
> Hi All,
>
> Is there a way that makes it possible to export sql query results as a xml file?
> I use postgres 7.4.7 on a debian system. Do i need any packages to
> export query results as a xml file if its possible?

No, we have discussed it but it seems there is no standard XML export
format for databases, so you have to use something to use the COPY
output into XML.  Perhaps there is an CSV to XML conversion tool you can
use.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: postgres and xml

From
Sean Davis
Date:
On Jun 10, 2005, at 12:02 PM, Bruce Momjian wrote:

> Hrishikesh Deshmukh wrote:
>> Hi All,
>>
>> Is there a way that makes it possible to export sql query results as
>> a xml file?
>> I use postgres 7.4.7 on a debian system. Do i need any packages to
>> export query results as a xml file if its possible?
>
> No, we have discussed it but it seems there is no standard XML export
> format for databases, so you have to use something to use the COPY
> output into XML.  Perhaps there is an CSV to XML conversion tool you
> can
> use.

While there isn't a "format" for XML from databases, it is possible to
dump stuff from the database into some form of XML.  You could then use
XSLT to transform it into other forms as needed.

Here is a link of interest, but there are numerous others like it.

http://www.samspublishing.com/articles/article.asp?p=30081&rl=1

Sean