SELECT vs COPY (SELECT) TO STDOUT I need to read more rows than fit in memory, resonably fast. I see two options:


SELECT ... where my bindings use a cursor to stream the rows;
COPY (SELECT ...) TO STDOUT (FORMAT binary) where my bindings decode the binary format into rows.


What are the theoretical differences in performance and behaviour between the above approaches, or are they effectively identical?
As far as the server and the network protocol are concerned, the result of a query and the binary COPY protocol are pretty much identical.

So you would choose COPY only if your client's PG library handles it better in your situation.