Skip to content
This repository was archived by the owner on Jul 12, 2025. It is now read-only.
This repository was archived by the owner on Jul 12, 2025. It is now read-only.

Support serialisation of pgtype.Type  #216

@nicois

Description

@nicois

I am using pgx(pool) with a database where there are a lot of custom types which need registering. Even using some smarts to only register the types actually used by a given application, it still takes multiple seconds to collect all the *pgtype.Type values.
While this is acceptable for non-interactive long-running applications, this reduces the viability of using pgx to build command-line tools.
I have tried to mitigate this problem by caching the results of LoadType, but I see:

some values are not fixed-sized in type pgtype.Type

Would it be possible to, one way or another, allow Type to be serialised?

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