can't scan into dest[0]: cannot scan uuid (OID 2950) in binary format into uuid.UUID #2074
Answered
by
DanielCoder834
DanielCoder834
asked this question in
Q&A
-
I am trying debug an issue I am having, which suspect is a race condition, by doing a select all query to the table causing the issue. rows, _ := dbpool.Db.Query(ctx, `SELECT * FROM "user"`)
var id uuid.UUID
var user string
var email string
var pass string
_, err := pgx.ForEachRow(rows, []any{id, user, email, pass}, func() error {
log.Printf("id: %s\n", id)
log.Printf("user: %s\n", user)
log.Printf("email: %s\n", email)
log.Printf("pass: %s\n", pass)
return nil
})
if err != nil {
log.Printf("err: %s\n", err)
} I am not sure what the issue is, but when I ran this code, I got the error in the title. |
Beta Was this translation helpful? Give feedback.
Answered by
DanielCoder834
Jul 5, 2024
Replies: 1 comment
-
This post didn't come up when I searched on github. It did when I searched on google: #740 The solution was to turn []any{id, user, email, pass} -> []any{&id, &user, &email, &pass} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
DanielCoder834
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This post didn't come up when I searched on github. It did when I searched on google: #740
The solution was to turn []any{id, user, email, pass} -> []any{&id, &user, &email, &pass}