lib / pq

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

Nil byte array doesn't get saved as JSONB field #1159

Open kooskoos20 opened 5 months ago

kooskoos20 commented 5 months ago

When you try to assign a nil byte array to JSONB field it returns an error. It works fine when byte array is not nil.

var byteArray []byte _, err := c.db.Exec(query, byteArray)

The above code fails with errorCode: ‘22P02’,