Closed stevesuh closed 3 years ago
I"m actually also interested in trying to get the equivalent of array[]::int[]
in SQL via the Int2Array
type.
The Go type pgtype.Int2Array
is not the corresponding type for the PostgreSQL type int[]
. You need to use pgtype.Int4Array
.
Thank you that helped to get past the ERROR. I got the empty array I wanted as well. Thanks again.
pgtype.Int4Array{
Elements: nil,
Dimensions: nil,
Status: pgtype.Present,
}
I'm getting the following error trying to insert into a integer[] column in Postgres:
ERROR: wrong element type (SQLSTATE 42804)
I'm hardcoding the value now just to see what's going on:
Any ideas?