There is a table mydocs with columns (id serial, docform int, content text) I make such a query

copy (select (content) from mydocs where id=30 ) to 'D:/html/ex10.xml' ; 

I select one file with id = 30 and put it in an existing or in a new file in the path folder, everything works but

 <?xml version="1.0" encoding="utf-8"?> \r\n <tutorial> \r\n <title>&quot;Заметки об XSL&quot;</title> \r\n <author>лермонтов</author> \r\n </tutorial> 

In the version of the document that is placed in the file there are \ r and \ n, as I understand this formatting, so how to get rid of it, or how to find a function that will humanly put xml in a file?

    1 answer 1

     copy (select (replace(content, e'\r\n', '')) from mydocs where id=30 ) to 'c:/data/ex10.xml'; 

    It seems to work