Re: procedure to load xml file data in postgesql - Mailing list pgsql-general

From Stephane Bortzmeyer
Subject Re: procedure to load xml file data in postgesql
Date
Msg-id 20080727095848.GA16735@laperouse.bortzmeyer.org
Whole thread Raw
In response to procedure to load xml file data in postgesql  (aravind chandu <avin_friends@yahoo.com>)
List pgsql-general
On Sat, Jul 26, 2008 at 02:32:05PM -0700,
 aravind chandu <avin_friends@yahoo.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>



pgsql-general by date:

Previous
From: Rich Shepard
Date:
Subject: Re: Problems Restarting PostgreSQL Daemon
Next
From: aravind chandu
Date:
Subject: Getting data from Xml to Postgresql database