pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joost Kraaijeveld <J.Kraaijeveld@Askesis.nl>
To: pgsql-sql@postgresql.org
Cc: pgsql-interfaces@postgresql.org
Subject: Howto convert / (re)store xml column to table in trigger using contrib/xml2?
Date: Sat, 12 May 2007 11:32:08 +0200
Message-ID: <1178962328.4937.8.camel@panoramix> (raw)

Hi,

Is it possible to convert / (re)store a column that contains xml (see
below) into real table in a trigger, using contrib/xml2?

The reason is that an application stores a xml blob in a column but we
need the data in a real table for a third party report generator. So I
want to use a trigger that, upon insert, update or delete, moves the
data into that table.

The XML looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<data>
	<field>
		<name>field1</name>
		<value>value1</value>
	</field>
	<field>
		<name>field2</name>
		<value>value2</value>
	</field>
</data>

And I have a table with the (text) columns field1 and field2.

Any pointers to a solution is really appreciated (solutions also ;-))

TIA


-- 
Groeten,

Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
web: www.askesis.nl



Message-ID: <1178962328.4937.8.camel@panoramix>
Permalink:  ../1178962328.4937.8.camel@panoramix/
Also on:    postgresql.org/message-id/1178962328.4937.8.camel@panoramix

 · 

reply

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-interfaces@postgresql.org
  Cc: J.Kraaijeveld@Askesis.nl, pgsql-sql@postgresql.org
  Subject: Re: Howto convert / (re)store xml column to table in trigger using contrib/xml2?
  In-Reply-To: <1178962328.4937.8.camel@panoramix>

* 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