Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support serialisation of pgtype.Type #216

Open
nicois opened this issue May 26, 2024 · 1 comment
Open

Support serialisation of pgtype.Type #216

nicois opened this issue May 26, 2024 · 1 comment

Comments

@nicois
Copy link

nicois commented May 26, 2024

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?

@jackc
Copy link
Owner

jackc commented May 27, 2024

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

Yes, but it seems rather error prone. I'm more inclined to improve performance of loading types like you recommended in jackc/pgx#2030. Also, only bug fixes to this older version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants