Re: Allow backend to output result sets in XML

From: "Merlin Moncure" <merlin(dot)moncure(at)rcsonline(dot)com>
To: "Peter Eisentraut" <peter_e(at)gmx(dot)net>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Allow backend to output result sets in XML
Date: 2004-01-21 20:14:36
Message-ID: 303E00EBDD07B943924382E153890E5434AA6B@cuthbert.rcsinc.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut wrote:
> I think "output XML" is just buzz. Give us a real use scenario and an
> indication that a majority also has that use scenario (vs. the other
> ones listed above), then we can talk.

Consider:

create table person (name varchar primary key, age int);
create table account (number varchar primary key, name varchar
references person);
insert into person values ('Fred', 35);
insert into person values ('Barney', 37);
insert into account values ('1234', 'Fred');
insert into account values ('5678', 'Fred');
insert into account values ('abcd', 'Barney');

test=# select * from person into xml natural;
<?xml version="1.0" encoding="UTF-8" ?>
<result>
<row n="1">
<person>
<name>Fred</name>
<age>35</age>
<account>
<number>1234</number>
</account>
<account>
<number>5678</number>
</account>
</person>
</row>
</result>
<row n="2">
[...]

now consider:
select * from person into xml natural
namespace is 'some_uri'
schema is 'person.xsd';

this returns result set above, but with schema and namespace
declarations included. Of course, there is tons of complexity hiding in
there, but is this worth considering?

Merlin

Browse pgsql-hackers by date

  From Date Subject
Next Message Mike Mascari 2004-01-21 23:34:36 Re: CTTAS w/ DISTINCT ON crashes backend
Previous Message Marc G. Fournier 2004-01-21 19:40:12 testing mail relays ...