I want to use the copy API to execute a parameterized query, as in
COPY (SELECT * FROM TABLE WHERE KEY=?) TO STDOUT FORMAT BINARY
As far as I can tell it is not currently possible to prepare this statement and pass it to the copy API.
Is there a way to accomplish this other than just building the SQL with values already substituted?