Skip to content
Discussion options

You must be logged in to vote

v4 is no longer supported and I would recommend upgrading to v5. But if I recall correctly, the way you would do this in v4 is with the pgtype.TextArray.

In v5 you would use https://pkg.go.dev/github.com/jackc/pgx/v5@v5.7.6/pgtype#Map.SQLScanner.

Unfortunately, in neither version can you directly scan to a []string. However, thanks to golang/go#67546, in future versions of Go and pgx you will be able to directly scan to []string and other slice types directly with database/sql / stdlib.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dapoadedire
Comment options

Answer selected by dapoadedire
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants