export data from postgresql I have some text like xml -code in a field of table. I want to export the data from my field into file without any changes.

I've tried to use a lot of variants but all of them changes the text. The most successful variants were:

COPY (SELECT alll FROM super.a_a ) TO 'D:\alll.txt' CSV ;


But there appeared extra quotes "".

COPY (SELECT alll FROM super.a_a ) TO 'D:\alll.txt CSV QUOTE ' ' ;


But there appeared extra spaces.

In my field I have such date like : name="firsname" and when I use any of varients I get something like that : name=""firstname"" or name=\n\r"firstname\n\r""
Maybe, you can just execute the query in psql and redirect its output to a file after removing all headers. Did you try something like:

$ psql
user=&gt; \o outputfile.txt
user=&gt; \t on
user=&gt; SELECT alll FROM super.a_a;
user=&gt; \q