lib / pq

Pure Go Postgres driver for database/sql
https://pkg.go.dev/github.com/lib/pq
MIT License
9.02k stars 910 forks source link

cant use copyin. sql: expected 0 arguments, got 13 #901

Closed k1ng440 closed 4 years ago

k1ng440 commented 4 years ago

sorry

justclimber commented 1 year ago

@k1ng440 how did you solve this issue? I have the same issue and can't find the solution )

k1ng440 commented 1 year ago

It's been a couple of years. I have forgotten how I have solved it. Sorry

wuhan005 commented 8 months ago

@k1ng440 how did you solve this issue? I have the same issue and can't find the solution )

As https://github.com/jackc/pgx#choosing-between-the-pgx-and-databasesql-interfaces mentioned:

Many PostgreSQL specific features such as LISTEN / NOTIFY and COPY are not available through the database/sql interface.

Maybe you used the database/sql interface which does not support COPY IN to connect the database by mistake. Try to use github.com/jackc/pgx instead.

FYI: https://pkg.go.dev/github.com/jackc/pgx/v5#hdr-Copy_Protocol