Repository navigation
Create a function to get a type's name from an oid - #39877
Open
SangJunBak wants to merge 1 commit into
Open
SangJunBak wants to merge 1 commit into
SangJunBak wants to merge 1 commit into
Conversation
SangJunBak
added this pull request to stack #39878
October 15, 2026 19:42
SangJunBak
force-pushed
the
jun/name-from-oid
branch
from
October 15, 2026 20:46
0905ee5 to
7def23a
Compare
SangJunBak
marked this pull request as ready for review
October 15, 2026 20:47
Our existing name_from_oid function (`Type::from_oid`) only accepts `oid`s that `rust-postgres` knows about, thus we need to create a function for our custom OIDs too. There's a chance of skew in case we add a new scalar type and don't remember to update this function. However, this function is intended to be temporary. To explain, we use this function such that our builtin relation `mz_catalog.mz_columns` can get a type's name from its durably stored `oid` using a SQL scalar function. However, we can replace the scalar function with a join on `mz_builtin_types` once it's been migrated to a builtin materialized view.
SangJunBak
force-pushed
the
jun/name-from-oid
branch
from
October 15, 2026 22:01
7def23a to
6b0bdc9
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.
Our existing name_from_oid function (
Type::from_oid) only acceptsoids thatrust-postgresknows about, thus we need to create a function for our custom OIDs too.There's a chance of skew in case we add a new scalar type and don't remember to update this function. However, this function is intended to be temporary. To explain, we use this function such that our builtin relation
mz_catalog.mz_columnscan get a type's name from its durably stored
oidusing a SQL scalar function.However, we can replace the scalar function with a join on
mz_builtin_typesonce it's beenmigrated to a builtin materialized view.
Motivation
Part of sql-494
Verification
This is a small change that expands a function that simply maps an oid to a string.