Reputation: 7260
I want to export the selected records into the text file.
\COPY (SELECT * FROM Table_Name) TO '/root/Exported_Data.txt'
Note: The above script just giving me same records, BUT NOT appending any duplicate or non duplicate records.
Upvotes: 1
Views: 3377
Reputation: 393
Following link might help in appending data to a file using copy command:
https://dba.stackexchange.com/questions/149745/copy-command-in-postgresql-to-append-data/149774#149774
Upvotes: 1