here is cleaned/finished previous implementation of RAW_TEXT/RAW_BINARY formats for COPY statements.
The RAW with text formats means unescaped data, but with correct encoding - input/output is realised with input/output function. RAW binary means content produced/received by sending/received functions.