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

Re: XML ouput for psql

From: Alan Gutierrez <ajglist(at)izzy(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: XML ouput for psql
Date: 2003-03-06 03:53:35
Message-ID: 20030306035335.GB10852@maribor.izzy.net (view raw or flat)
Thread:
Lists: pgsql-hackers
* Merlin Moncure <merlin(dot)moncure(at)rcsonline(dot)com> [2003-03-05 10:02]:

> > Acually, the difficult part has been getting the information back
> > into the database. Getting it out is a very simple query. I imagine
> > that every language/environment has an SQL->XML library somewhere,
> > but I wasn't able to find something that would go from XML to SQL.

> XSLT could be used to convert virtually any xml table format directly
> into an insert statement.  For me, this is better than using a
> programming language plus a parser.  XSLT is quite powerful and fast and
> is build on top of xpath, and is a closer fit to the declarative
> programming model of sql.  Validation could be done at the xslt stage or
> with schemas, which I prefer.

XSLT, or Perl, or anything. That's not a problem. It becomes a
problem when I have to hand write insert/update statements for every
type of element in an XML document.

<person>
  <first-name>Alan</first-name>
  <last-name>Gutierrez</last-name>
  <ssn>1234565789</ssn>
</person>

If I feed this document to a database I want it to absorb the
document, inserting if doesn't already exists, updating it if it
does. There is no way to test for the existstence of a record in a
person table during an XSLT transformation.

-- 
Alan Gutierrez - ajglist(at)izzy(dot)net
http://khtml-win32.sourceforge.net/ - KHTML on Windows

In response to

pgsql-hackers by date

Next:From: Greg StarkDate: 2003-03-06 04:10:26
Subject: Re: Aggregate "rollup"
Previous:From: Christopher Kings-LynneDate: 2003-03-06 03:18:24
Subject: pgsql.com website store

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