Skip site navigation (1) Skip section navigation (2)

Re: Related to Inserting into the database from XML file

From: "George Pavlov" <gpavlov(at)mynewplace(dot)com>
To: "Jeff Davis" <pgsql(at)j-davis(dot)com>,"soni de" <soni(dot)de(at)gmail(dot)com>
Cc: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Related to Inserting into the database from XML file
Date: 2006-08-27 14:18:09
Message-ID: 8C5B026B51B6854CBE88121DBF097A863CD6DB@ehost010-33.exch010.intermedia.net (view raw or flat)
Thread:
Lists: pgsql-performance
> On Fri, 2006-08-25 at 21:23 +0530, soni de wrote:
> > Hello,
> >  
> > I want to ask, Is there any way to insert records from XML 
> > file to the postgres database?
> 
> Try the contrib/xml2 module.

Alas, that module will not help you much with the insertion of records.
It is more about querying XML that is stored within the database. 

A basic question is whether you want to store XML in the DB or you just
have data that is in XML now and you want it loaded into a table
structure. The xml2 module will only be useful in the first case.

In either case the approach is to transform the data into a form that
PGSQL's COPY understands or into a bunch of INSERT statements (much less
performant). To that end you probably want to become familiar with XSLT
unless the data is so simple that a processing with regular tools (perl,
sed, awk) will suffice.

George

In response to

Responses

pgsql-performance by date

Next:From: George PavlovDate: 2006-08-27 14:24:21
Subject: Re: stats reset during pg_restore?
Previous:From: Alvaro HerreraDate: 2006-08-27 02:45:54
Subject: Re: stats reset during pg_restore?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group