-
Notifications
You must be signed in to change notification settings - Fork 134
Convert PG Composite Types to Tuples in CH #3190
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
base: main
Are you sure you want to change the base?
Convert PG Composite Types to Tuples in CH #3190
Conversation
#3066 introduced versioning as a simpler alternative to settings for maintaining backwards compatibility |
wanted to get to bringing this to a point we can merge, but been falling behind this past month |
I'm doing a bit of refactoring right now and fixing several issues. Will be ready for review in a day or 2. |
add45b7
to
8b328d1
Compare
Hi @serprex @heavycrystal, it's ready for reviewing. I've added a new version |
compositeTypeNames = append(compositeTypeNames, typeData.Name) | ||
} | ||
} | ||
types, err := c.conn.LoadTypes(ctx, compositeTypeNames) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is failing in CI for #3384
failed to fetch custom type mapping: failed to load composite types: Unknown field for composite type "geometry_dump": field "geom" (OID 18053) is not already registered.
seems like there's a mess with having to make sure dependencies are registered before loading. Looking at LoadTypes
this can probably be cleaned up to query catalog ourselves for composite types specifically & figure out how to register types in correct order
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird, LoadTypes
already has some logic for registering children types before parents: https://github.com/jackc/pgx/blob/master/derived_types.go#L82-L84
Currently custom composite types from postgres are saved as strings in CH which makes it inconvenient to access/filter/sort/etc them. This PR adds functionality converting composite types to Tuple.
Nullable(Tuple(...))
so instead every field of tuple is createdNullable
(ifPEERDB_NULLABLE
is enabled)