From: CoL <col@mportal.hu>
To: pgsql-sql@postgresql.org
Subject: Re: XML & Postgres Functions
Date: Tue, 02 Dec 2003 11:20:54 +0100
Message-ID: <bqhp0t$1v1q$2@news.hub.org> (raw)
In-Reply-To: <20031201221706.MQPG28419.fed1mtao03.cox.net@brook.zerobearing.org>
References: <20031201221706.MQPG28419.fed1mtao03.cox.net@brook.zerobearing.org>
hi,
zerobearing2 wrote:
> Hi all-
>
> I'm migrating to postgres from the MS SQL Server land, as I can see
> a great potential with postgres, I was wondering if anyone has
> experimented or started a project with XML inside user defined
> functions?
>
> I've seen the contrib/xml shipped with the distro, as I see it's
> usefulness, it's not quite what I had in mind (lacks the ablity to
> return recordset/table of nodes). Also, the project XpSQL seems
> interesting, but still not it.
>
> I'm looking for a solution similar to the OpenXML that MS implements
> in their SQL Server. A way to parse XML into a table and/or a temp
> table for use inside a function. For example, I would like to
> serialize my objects into XML, send them to a postgres function for
> saving/updating the relational data inside postgres.
>
> I envision something of the following could be useful:
>
> XML
> ------
> <table>
> <row field1="Testing" field2="Testing2" updateflag=1/>
> ...
> <row field1="TestingN" field2="TestingN+2" updateflag=1/>
> <table>
>
>
> UDF
> ------
> create function somefunc(xmldata text)
> begin
> xmldoc := preparedoc(xmldata);
> ....
> update tablename set
> field1=x.field1,
> field2=x.field2,
> from xmltable(xmldoc, '/table/row[@updateflag=1]') as x
> ....
> preform removedoc(xmldoc);
> end;
Check the xml dir under contrib.
Or/And
http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=utf-8&q=xml+in+postgres+site%3Apo...
C.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: col@mportal.hu
Subject: Re: XML & Postgres Functions
In-Reply-To: <bqhp0t$1v1q$2@news.hub.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox