Skip to content

Encoder panics on composite type arrays containing pgtype.Numeric #102

Open
@kirk-anchor

Description

@kirk-anchor

Using an array of a composite type with a numeric column and no --go-type override results in a panic

panic: encode []FeeConfig: cannot convert {1 -2 2 false none} to Numeric

This does not occur if your generated structs use a string with --go-type 'numeric=string'

However pgtype.Numeric has a bug in string conversion, I reported it upstream jackc/pgtype#210

For now, I will use the last pggen commit that still contains QuerierConfig and everything works properly with --go-type 'numeric=github.com/shopspring/decimal.Decimal'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions