Вопрос

Is there an equivalent of Microsoft .Net's SQLXML Bulk Load (http://msdn.microsoft.com/en-us/library/ms171878.aspx) for Postgresql/PostGIS that I can run on linux? I have a huge and complicated XML file I'd like to import into PostGIS on a linux server without having to write a ton of code to shred the XML. I already have the XSD for it (this one: http://www.dft.gov.uk/transxchange/schema/schemas.htm) so I was hoping I could just specify the relations in the XSD (eg sql:key-fields="ProductID") and set it going.

If there isn't what's the next best thing to import it if I don't want to have to spend weeks writing code to convert XML into tables?

Это было полезно?

Решение

I am not aware of any utility, but I wonder if this is because, for the most of the open source weakly typed languages have good XML file parsers you could use to just pull it into a giant data structure and process it however you like.

So assuming you don't have files that are are huge, my recommendation would be something like Perl, DBI, and XML::Simple.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top