Repository navigation
fix: keep schema qualifier on casts to shadowed types in routine defaults (#701 follow-up) - #729
Merged
Merged
Conversation
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Contributor
[Medium impact] This PR appears safe to merge. SummaryPreserves required schema qualifiers on casts to shadowed types in routine defaults.
Acknowledged scope: Reviews (1) · Last reviewed commit: "fix: keep schema qualifier on casts to s..." · Reviewed by Greptile |
devin-ai-integration
Bot
changed the base branch from
fix/issue-701-shadowed-type-qualifier
to
main
November 29, 2026 11:54
…ults (#701) Co-Authored-By: Tianzhou <t@bytebase.com>
Co-Authored-By: Tianzhou <t@bytebase.com>
…ation Co-Authored-By: Tianzhou <t@bytebase.com>
Co-Authored-By: Tianzhou <t@bytebase.com>
devin-ai-integration
Bot
force-pushed
the
devin/1795951143-shadowed-type-defaults
branch
from
November 29, 2026 11:54
4e67785 to
f6fbcfe
Compare
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.
Summary
Follow-up to #727 (stacked on its branch). A routine parameter default cast to a same-schema type that a
pg_catalogtype shadows lost its qualifier:The
::schema.cast stripping happened in three places; all now go through a newir.StripCastQualifiers(value, castQualifierRe, shadowedTypes), which keeps the qualifier when the following identifier is inMetadata.ShadowedTypes:normalizeDefaultValue(both the::pgschema_tmp_*.and same-schema regexes) — now takesshadowedTypes; routine callers pass it, column defaults passnil.newSameSchemaQualifierStripperincmd/plan(maps temp → target, then strips).formatFunctionParametervia newstripDefaultSchemaPrefix.Not covered: table column types of a shadowed type (e.g.
choice public.name) are still emitted bare, because the column query strips same-schema qualifiers in SQL; that needs aqueries.sqlchange and is out of scope here.Tests: new
create_function/issue_701_shadowed_type_defaultdiff/plan fixture (function + procedure),TestStripCastQualifiersKeepsShadowedTypes.Link to Devin session: https://app.devin.ai/sessions/2160d3f08fd1454bb91db03645ac0427
Open in Devin Desktop: https://app.devin.ai/desktop/session/2160d3f08fd1454bb91db03645ac0427?variant=devin
Requested by: @tianzhou
🟢 Devin Review found nothing to fix · View findings · Follow Devin's work