Move type loading to use the data type name constructors#6507
Conversation
Just like we do in PostgresMinimalDatabaseInfo
|
@NinoFloris just tested this PR and can confirm it solved my issue! Thanks ❤️ |
There was a problem hiding this comment.
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
DataTypeNameparsing/display logic to only apply alias mapping forpg_catalog(or unqualified) names. - Switch type loading in
PostgresDatabaseInfoto construct types from fully-qualifiedDataTypeNamevalues. - Expand
DataTypeNameTeststo cover schema-qualified alias/non-alias cases andUnqualifiedDisplayNamebehavior.
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.
|
@NinoFloris I noticed that this change is not in the 10.0.3 branch, Do you still intend on having this backported? |
(cherry picked from commit 63cfeb7)
|
Yes this should have been backported. Thanks! Backported to 10.0.3 via 170cd04 |
Move type loading to use the data type name constructors, just like we already do in PostgresMinimalDatabaseInfo.
Closes #6367