doukuipei9938 2019-08-20 16:11
浏览 253
已采纳

如何将pgtype.Int4Array(从pgx库)转换为[] int64 Golang类型?

I use Go and Postgres (with pgx driver)

In my Postgres table I have a field with array of integers. I have created a variable to store array of integers after scanning.

var ids pgtype.Int4Array

How to convert ids to []int64?

  • 写回答

1条回答 默认 最新

  • douan2907 2019-08-20 16:20
    关注

    Use ids.AssignTo(&sliceOfInt64)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?