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
When I send a query parameter that is the wrong type, I get an (expected) error message like "invalid input syntax for integer". But then any queries I run after that return errors too: usually something like "pq: unexpected parse response: '3'"
So apparently when the driver receives an "invalid input syntax" error, it needs to read some more messages before returning—or just close the connection and open a new one.
I'm using PostgreSQL 9.1alpha2
Sample program that exhibits this error:
package main
import (
"database/sql"
"fmt"
_ "github.com/bmizerany/pq"
)
func main() {
db, err := sql.Open("postgres", "user=postgres dbname=postgres sslmode=disable")
if err != nil {
fmt.Println(err)
return
}
_, err = db.Exec("create table test (i integer)")
if err != nil {
fmt.Println(err)
return
}
_, err = db.Query("select * from test where i=$1", "hhh")
fmt.Println(err)
_, err = db.Query("select * from test where i=$1", 1)
fmt.Println(err)
}
The text was updated successfully, but these errors were encountered:
When I send a query parameter that is the wrong type, I get an (expected) error message like "invalid input syntax for integer". But then any queries I run after that return errors too: usually something like "pq: unexpected parse response: '3'"
So apparently when the driver receives an "invalid input syntax" error, it needs to read some more messages before returning—or just close the connection and open a new one.
I'm using PostgreSQL 9.1alpha2
Sample program that exhibits this error:
The text was updated successfully, but these errors were encountered: