Re: converting tables to XML and back

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: converting tables to XML and back
Date: 2010-01-05 14:06:51
Message-ID: 20100105140651.GX5407@samason.me.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Jan 04, 2010 at 07:46:29AM -0800, shulkae wrote:
> We have few tables which we would like to convert to XML and store it.

Not sure if you've seen them, but Postgres provides a few built in functions that will help with simple tasks:

http://www.postgresql.org/docs/current/static/functions-xml.html

> Another requirement is to convert the stored XML file back to the
> original tables. This helps us to clone a system. I was thinking to
> use Perl XML Simple module to generate XML files.

Not tried to do this, but the functions from above should help.

> How do I again re-create tables from XML?

xpath() is what I've used for this before. It's performance isn't
amazing, but it's been enough for the things I've used it for.

--
Sam http://samason.me.uk/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2010-01-05 14:08:11 Re: Looking for advice on working with revisions
Previous Message Dimitri Fontaine 2010-01-05 13:56:35 Re: converting tables to XML and back