Repository navigation
SQL-495: Convert the type system tables to catalog views - #40843
Open
SangJunBak wants to merge 7 commits into
Open
SangJunBak wants to merge 7 commits into
SangJunBak wants to merge 7 commits into
Conversation
SangJunBak
force-pushed
the
jun/sql-495/type-relations
branch
from
November 18, 2026 07:41
da74c19 to
83a55e5
Compare
SangJunBak
changed the base branch from
jun/type-relations
to
jun/builtin-view-migration
November 18, 2026 07:50
SangJunBak
marked this pull request as ready for review
November 18, 2026 07:50
This was referenced Nov 18, 2026
SangJunBak
force-pushed
the
jun/sql-495/type-relations
branch
2 times, most recently
from
November 18, 2026 23:01
2155c23 to
a8161bd
Compare
- Create mz_internal.mz_builtin_types to report builtin types. Essentially a move of the packing code from builtin_table_updates to make_builtin_types. The exception being.... - We extract `from_builtin_oid` from `name_from_oid` to get a mapping from a builtin catalog type to the pgwire typlen. We need `from_builtin_oid` since the builtin table way of getting the postgres type requires the catalog and SQLScalarTypes. This is because user types can be recursive. However our builtin types cannot be and we can use `from_builtin_oid`. To prevent drift, we add a test in catalog.rs that asserts `from_builtin_oid` against types via pgwire.
- Adds decoding code for user types - Converts mz_types, mz_array_types, mz_base_types, mz_list_types, mz_map_types, mz_pseudo_types and mz_type_pg_metadata to builtin views
- Creates tests for each builtin type relations such that it maintains parity with our previous builtin type relations - Creates a test on `try_decode_catalog_create_sql` and assert how errors affect the relation
This is to test that types in the catalog are parsed successfully on upgrade. We add LIST and MAP types too, something that was missing from the original platform check.
In postgres, _record has a typlen of -1 rather than NULL and this was previously a bug. Because we use `from_oid` now, this corrects that behavior.
SangJunBak
force-pushed
the
jun/sql-495/type-relations
branch
from
November 19, 2026 00:43
a8161bd to
8f35c46
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See commit messages for details. These are quite simple builtin table conversions. We get the user custom types from the catalog and the rest statically from our list of builtins.
Motivation
Closes SQL-495
Verification