CREATE TABLE foo(bar XML);
COPY foo FROM '/Caminho/Para/Arquivo/Xml/arquivo.xml';
SELECT xpath('./elemento1/text()', bar) from foo
xpath
-----------------------
{"valor do elemento"}
postgres=# SELECT * FROM foo;
bar
-------------------------------------------------------------------------------------------------
<teste f="a"><elemento1>valor do elemento</elemento1><elemento2
x="blehh">2</elemento2></teste>
-Leo
2014-10-24 4:24 GMT-02:00 Wellington <[email protected]>:
> Pessoal,
>
> como faço para importar um aquivo XML para uma tabela no PostgreSQL 9.1 ?
> Alguem teria um exemplo ?
> Gostaria de importar alguns arquivos e buscar os valores de algumas tags.
> Eu li a documentacao, mas nao consegui entender a sintaxe.
>
>
> Desde ja, agradeço.
> Wellington
> _______________________________________________
> pgbr-geral mailing list
> [email protected]
> https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral
>
--
Leonardo Cezar
http://www.postgreslogia.com
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral