Re: Select Output in XML format

From: Chetan Suttraway <chetan(dot)suttraway(at)enterprisedb(dot)com>
To: Adarsh Sharma <adarsh(dot)sharma(at)orkash(dot)com>
Cc: pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Select Output in XML format
Date: 2011-09-08 08:08:33
Message-ID: CAPtHcnGgoOQQqbhBg=CA_DhpBJXETdsd_EPrFStQwAhb=wGyLA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Sep 8, 2011 at 12:53 PM, Adarsh Sharma <adarsh(dot)sharma(at)orkash(dot)com>wrote:

> Thanks I am trying as below ;
>
>
> db_name=# select table_to_xml(tbl master, nulls boolean, tableforest
> boolean, targetns text);
> ERROR: syntax error at or near "master"
> LINE 1: select table_to_xml(tbl master, nulls boolean, tableforest b...
> ^
> Do I need to use both functions
>
>
Check the below syntax:

--already created base table
pg=# desc base;
Table "public.base"
Column | Type | Modifiers
--------+---------+-----------
a | integer |
Number of child tables: 1 (Use \d+ to list them.)

pg=# select table_to_xml( 'base', true, true, '');
table_to_xml
--------------------------------------------------------------
<base xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
+
<a>1</a> +
</base> +
+
<base xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
+
<a>2</a> +
</base> +
+

(1 row)

--
EnterpriseDB Corporation
The Enterprise PostgreSQL Company

Website: www.enterprisedb.com
EnterpriseDB Blog : http://blogs.enterprisedb.com
Follow us on Twitter : http://www.twitter.com/enterprisedb

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Chetan Suttraway 2011-09-08 08:12:54 Re: Select Output in XML format
Previous Message Eduardo Piombino 2011-09-08 07:49:11 Re: Lock problem