However copy eats those backslashes. I need to use quote_literal() but that's a syntax error. For some reason the COPY command doesn't allow for ESCAPE to work with programs, only CSV.
I tried using WITH BINARY but I get the error message: "COPY file signature not recognized"
Does anyone know how to make COPY FROM PROGRAM take the output literally?