Mapping arbitriary and heirachical XML to tuple

From: "Mark Woodward" <pgsql(at)mohawksoft(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Mapping arbitriary and heirachical XML to tuple
Date: 2006-09-08 21:26:55
Message-ID: 18974.24.91.171.78.1157750815.squirrel@mail.mohawksoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I have a system by which I store complex data in PostgreSQL as an XML
string. I have a simple function that can return a single value.

I would like to return sets and sets of rows from the data. This is not a
huge problem, as I've written a few of these functions. The question I'd
like to put out there, is how would you represent heirarchical data as:

<foo>
<bar>
<ndx>0</ndx>
<val>1.00</val>
<meta>2.5</meta>
<froboz>3.5</froboz>
<klude>
<item>5</item>
<life>10</life>
</kludge>
</bar>
<bar>
<ndx>1</ndx>
<val>1.10</val>
<meta>2.2</meta>
<froboz>3.53</froboz>
<klude>
<item>3</item>
<life>9</life>
</kludge>
</bar>
</bar>

The biggest problem with XML is storing data is easy, getting it back out
in a sane way is less so. How would you guys think to represent this?
(Obviously, this is a bogus example, real life would be much worse!)

Browse pgsql-hackers by date

  From Date Subject
Next Message mark 2006-09-08 22:07:30 Re: Fixed length data types issue
Previous Message Tom Lane 2006-09-08 21:20:18 Re: Domains and subtypes, a brief proposal