I'm using Postgres 9.5.
This is my Postgres Table.
create table testXml(XmlFile xml);
I have an XML file in my local Folder.
<?xml version="1.0" ?><Student><Id>1</Id><Marks>275</Marks><Rank>2</Rank></Student>
I want insert the file into my table. I can able to insert the file when it located in the data directory.
I found an alternate way but it returns OID value:
SELECT lo_import('/home/dinesh/Desktop/test.xml');
When runs this, it gives the result : 17994
But I need the XML value as my result.
I can't able to find a clear solution to convert the OID to XML value.
Please help me to get the correct result.
Thanks in Advice.
lo_importwith thexmltype (andlo_importcan only access files on the server anyway).