Skip to content

No longer able to retrieve enum array in v1.9.0 using pgx #1126

Closed as not planned
@rhodee

Description

@rhodee

Prior to 1.9.0 sqlc was able to return an ([]interface{}, error) for the following kind of query:

My code sets up the following query:

-- name: LotAltitude :many
SELECT unnest(enum_range(null::lot_altitude_designation))

I get the following error:

can't scan into dest[0]: unknown oid 20450 cannot be scanned into *interface {}

So I did some research and found the RegisterDataType method. This however has raised more questions of how to provide the pointer value to satisfy the pgtype.Value.

When I revert to 1.6.0 the issue is no longer present. Is there any guidance you can provide for getting unblocked?

Awesome work team and I appreciate you helping me level up my pgx knowledge -

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions