You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The overall process is that the application first issues the SQL COPY command via PQexec or one of the equivalent functions. The response to this (if there is no error in the command) will be a PGresult object bearing a status code of PGRES_COPY_OUT or PGRES_COPY_IN (depending on the specified copy direction).
This suggests PQexecParams should also be usable (and thus parameters can be passed on the protocol level).
The text was updated successfully, but these errors were encountered:
I don't think this is possible. pgx handles parameters via the extended protocol / prepared statement interface (and when using the simple protocol it simulates that as closely as possible). But the COPY TO SQL string doesn't actually take any parameters as far as PostgreSQL is concerned.
Is your feature request related to a problem? Please describe.
CopyTo
does not take parameters, only a string.Describe the solution you'd like
CopyTo
should be takingarguments ...any
just likeExec
does.Describe alternatives you've considered
Exporting a way to correctly quote parameters into an SQL string. (But it is not a good alternative.)
Additional context
This seems to be a backward compatible change. Also it is parallel to how other APIs (e.g.
Exec
) of this package work.Documentation of COPY with libpq: https://www.postgresql.org/docs/current/libpq-copy.html
This suggests
PQexecParams
should also be usable (and thus parameters can be passed on the protocol level).The text was updated successfully, but these errors were encountered: