Hi, I'd like some input on the idea of adding parameter binding support to queries executed as part of a COPY TO command. Is there a technical or philosophical reason why these queries should not contain bindable parameters?
As far as I could ascertain, the feature has been desired for a long time (but only occasionally), see e.g.: * https://www.postgresql.org/message-id/flat/12415.1550157763%40sss.pgh.pa.us#682d53c41bda2d21b7cd4fba5000793c * https://postgrespro.com/list/thread-id/1893680 * https://stackoverflow.com/questions/69233792/how-to-pass-a-param-for-a-binding-in-postgresql-copy-to-stdout-format * https://stackoverflow.com/questions/44190514/pdo-postgresql-copy/44190617#44190617 * https://github.com/npgsql/npgsql/issues/1677 * https://github.com/jackc/pgx/issues/2247#issuecomment-2645836118 Currently, the protocol forces users of COPY TO to use SQL quoting, resulting in multiple client libraries not supporting parameters in COPY TO, resulting in various users doing unsafe interpolations (I come here from one such occasion). I might have some time to attempt an implementation, but would first like to know if there are reservations against it. Thanks, Drahflow
signature.asc
Description: PGP signature