Re: procedure to load xml file data in postgesql

From: Stephane Bortzmeyer <bortzmeyer(at)nic(dot)fr>
To: aravind chandu <avin_friends(at)yahoo(dot)com>
Cc: postgresql Forums <pgsql-general(at)postgresql(dot)org>
Subject: Re: procedure to load xml file data in postgesql
Date: 2008-07-27 09:58:48
Message-ID: 20080727095848.GA16735@laperouse.bortzmeyer.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Jul 26, 2008 at 02:32:05PM -0700,
aravind chandu <avin_friends(at)yahoo(dot)com> wrote
a message of 149 lines which said:

> I have to load xml file data into postgresql database
> table using a stored procedure,but I didn't have any
> idea how to start it.

Well, the problem is much too open to provide any ready-to-use
solution. The way you describe it, it looks like a school
assignment. Is it so?

First, you need to decide what the XML data will look like in
PostgreSQL:

* you can slurp the entire file in a TEXT field (the simplest
solution),

* you can convert it to relational data (the schema conversion is not
obvious because XML data model is hierarchical, not relational, but
this solution will give you "nice" SQL data; your actual data look
quite tabular and therefore will fit well in a relational schema)

* you can use PostgreSQL native XML facilities (I cannot help, I've
never used them).
<http://developer.postgresql.org/pgdocs/postgres/datatype-xml.html>
and <http://developer.postgresql.org/pgdocs/postgres/functions-xml.html>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Suresh 2008-07-27 12:55:42 Profiling postgres
Previous Message Ivan Voras 2008-07-27 01:08:09 Re: PostgreSQL vs FreeBSD 7.0 as regular user