Skip to content

Scan array column fail #588

@hung-voanh

Description

@hung-voanh

Hi. I have postgresql table which column is string array type

I checked that all the data are correct.

When I run the models.MarketCategories.Query(), I got this error:

can't scan into dest[4] (col: sub_types): pq: unable to parse array; expected '{' at offset 0"}

Here are the struct that bob gen:

// MarketCategory is an object representing the database table.
type MarketCategory struct {
	...
	SubTypes     pq.StringArray      `db:"sub_types" json:"sub_types"` // this column get failed
	R marketCategoryR `db:"-" json:"-"`
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions