I understand, but I am not sure how difficult implementation it is. This part > (COPY input) doesn't support parametrization - and parametrization can have a > negative performance impact.
And it would need to be \:file_ref in COPY so real data doesn't trigger it.
ISTM it'd be much saner to just restrict file ref's to only working with psql's \COPY, and not server-side COPY.
Which is a great discussion for the thread on "COPY as a set returning function". I didn't mean to hijack this thread with a misguided tie-in.