Search Postgresql Archives

Re: For storing XML version in our table.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 20, 2016 at 3:09 AM, zubair alam <zzia88@xxxxxxxxx> wrote:
Hi 
    How i can store my xml  data with their version in postgres database table.

Works on 9.5...though it doesn't seem to validate the provided value, just stores it.

​SELECT E'<?xml version="1.0" encoding="UTF-8"?>\n<ele>Hi</ele>'::xml::text;

SELECT E'<?xml version="2.0" encoding="UTF-8"?>\n<ele>Hi</ele>'::xml::text;

CREATE TABLE xmltbl ( xmldata xml );

INSERT INTO xmltbl VALUES (E'<?xml version="2.0" encoding="UTF-8"?>\n<ele>Hi</ele>');
SELECT replace(xmldata::text, E'\n', '') FROM xmltbl; -- xml with version 2.0 (invalid, should be 1.1...but I digress)

​David J.​


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux