Skip to content

Move type loading to use the data type name constructors#6507

Merged
NinoFloris merged 2 commits into
mainfrom
fix-alias-name-type-loading
Mar 16, 2026
Merged

Move type loading to use the data type name constructors#6507
NinoFloris merged 2 commits into
mainfrom
fix-alias-name-type-loading

Conversation

@NinoFloris

@NinoFloris NinoFloris commented Mar 15, 2026

Copy link
Copy Markdown
Member

Move type loading to use the data type name constructors, just like we already do in PostgresMinimalDatabaseInfo.

Closes #6367

Just like we do in PostgresMinimalDatabaseInfo
@NinoFloris NinoFloris changed the title Move type loading to the data type name constructors Move type loading to use the data type name constructors Mar 15, 2026
@PauloHMattos

Copy link
Copy Markdown
Contributor

@NinoFloris just tested this PR and can confirm it solved my issue!

Thanks ❤️

Comment thread src/Npgsql/Internal/Postgres/DataTypeName.cs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refines PostgreSQL type-name normalization/display behavior to better preserve schema-qualified/custom type names (avoiding pg_catalog alias mapping in non-pg_catalog schemas), and updates type loading/tests accordingly.

Changes:

  • Adjust DataTypeName parsing/display logic to only apply alias mapping for pg_catalog (or unqualified) names.
  • Switch type loading in PostgresDatabaseInfo to construct types from fully-qualified DataTypeName values.
  • Expand DataTypeNameTests to cover schema-qualified alias/non-alias cases and UnqualifiedDisplayName behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
test/Npgsql.Tests/DataTypeNameTests.cs Updates/expands unit tests to validate new schema-sensitive alias/display behavior.
src/Npgsql/PostgresTypes/PostgresType.cs Updates DataTypeName construction and makes FullName lazily computed.
src/Npgsql/PostgresDatabaseInfo.cs Uses DataTypeName when instantiating PostgresType objects during catalog load.
src/Npgsql/Internal/Postgres/DataTypeName.cs Changes FromDisplayName signature and updates alias mapping/display rules based on schema.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread test/Npgsql.Tests/DataTypeNameTests.cs Outdated
Comment thread src/Npgsql/Internal/Postgres/DataTypeName.cs
@NinoFloris
NinoFloris merged commit 63cfeb7 into main Mar 16, 2026
14 checks passed
@NinoFloris
NinoFloris deleted the fix-alias-name-type-loading branch March 16, 2026 07:49
@PauloHMattos

Copy link
Copy Markdown
Contributor

@NinoFloris I noticed that this change is not in the 10.0.3 branch, Do you still intend on having this backported?

NinoFloris added a commit that referenced this pull request Apr 20, 2026
@NinoFloris

Copy link
Copy Markdown
Member Author

Yes this should have been backported. Thanks!

Backported to 10.0.3 via 170cd04

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

Successfully merging this pull request may close these issues.

Inconsistent load of domain type into DatabaseInfo

4 participants