Using COPY in Postgres I know COPY is the best utility to export the data from a table or a query to output files. But if we are doing an export like
\COPY (select * from table) to '/tmp/file.csv' WITH CSV;

How its different from running the select query and save the results later(like in a GUI tool) or psql -c'select * from table'&gt; output.csv
Any advantage of using COPY in terms of performance and caching?
The overall idea is, I'm trying to understand the performance benefits of exporting the data via read from select vs COPY from python psycopg
With COPY, the server formats the data, and there is no formatting effort on the client.
You should test it – that should be simple to benchmark.