seancorfield / next-jdbc

A modern low-level Clojure wrapper for JDBC-based access to databases.
https://cljdoc.org/d/com.github.seancorfield/next.jdbc/
Eclipse Public License 1.0
760 stars 90 forks source link

PostgreSQL claims missing parameter in COPY command #136

Closed seancorfield closed 4 years ago

seancorfield commented 4 years ago
 (next.jdbc/execute-one! t-conn
                          ["SELECT 1 WHERE 2 = ?" 2])
 (next.jdbc/execute-one! t-conn
                          ["COPY(SELECT 1 WHERE 2 = ?) TO '/tmp/foo.csv' WITH CSV DELIMITER ',' HEADER" 2])

Execution error (PSQLException) at org.postgresql.core.v3.QueryExecutorImpl/receiveErrorResponse (QueryExecutorImpl.java:2532).
ERROR: there is no parameter $1
  Position: 25
seancorfield commented 4 years ago

COPY cannot be parameterized so this is simply not valid PostgreSQL syntax.