I am trying to export a column type jsonb using the copy command as follow:
payload
-------
{"test": "testing"}
sudo -u postgres psql test_database -c "COPY (SELECT payload FROM test_table) TO STDIN CSV"
The output gives me quoted text which is not a correct json format:
"{""test"":""testing""}"
How can I get a correct json format ?