Skip to content

Add support for postgresql type names with dots#5971

Merged
vonzshik merged 3 commits into
npgsql:mainfrom
dvas-hash:support-pg-types-with-dots
Feb 4, 2025
Merged

Add support for postgresql type names with dots#5971
vonzshik merged 3 commits into
npgsql:mainfrom
dvas-hash:support-pg-types-with-dots

Conversation

@dvas-hash

Copy link
Copy Markdown
Contributor

Fixed the problem of converting type names with dots, for example the name "public.audit.sessiontype" was parsed incorrectly and had namespace after parse "audit" and name - "sessiontype".

If the schema is not null or empty, then displayname must contain only the type name.

@NinoFloris

Copy link
Copy Markdown
Member

Thanks, mind adding a few test cases?

Contributes to #5710

@dvas-hash

Copy link
Copy Markdown
Contributor Author

Contributes to #5972

@dvas-hash

Copy link
Copy Markdown
Contributor Author

Thanks, mind adding a few test cases?

Contributes to #5710

Added test case with schema_name."Test.type.name"

@dvas-hash

Copy link
Copy Markdown
Contributor Author

I need this fix in Npgsql v8, is it possible?

@vonzshik vonzshik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@vonzshik

Copy link
Copy Markdown
Contributor

I need this fix in Npgsql v8, is it possible?

Yeah, we'll probably backport it to npgsql 8. BTW could you try to rebase on the latest main? It looks like there is an issue with the CI pipeline.

@dvas-hash dvas-hash requested a review from Brar as a code owner January 17, 2025 12:21
@vonzshik

Copy link
Copy Markdown
Contributor

Huh, for some reason it shows much more changes than it should...

@dvas-hash dvas-hash force-pushed the support-pg-types-with-dots branch from 5b4ebb7 to d2e7534 Compare January 17, 2025 12:31
For composite type with dots in name, Postgresql returns name with quotes - scheme."My.type.name",
but for npgsql mapping we should use names without quotes - scheme.My.type.name
@dvas-hash dvas-hash force-pushed the support-pg-types-with-dots branch from d2e7534 to d7159a0 Compare January 17, 2025 12:33
@dvas-hash

dvas-hash commented Jan 17, 2025

Copy link
Copy Markdown
Contributor Author

Huh, for some reason it shows much more changes than it should...

Fixed, but unfortunately a few more reviewers were added because of this error

@vonzshik vonzshik linked an issue Feb 4, 2025 that may be closed by this pull request
@vonzshik

vonzshik commented Feb 4, 2025

Copy link
Copy Markdown
Contributor

OK, I think it's fine to merge this now.
@dvas-hash thank you for your contribution!

@vonzshik vonzshik merged commit 3505dc3 into npgsql:main Feb 4, 2025
vonzshik pushed a commit that referenced this pull request Feb 4, 2025
Fixes #5972

---------

Co-authored-by: Dmitry Vasliyev <dmitry.vasilyev@veeam.com>
(cherry picked from commit 3505dc3)
vonzshik pushed a commit that referenced this pull request Feb 4, 2025
Fixes #5972

---------

Co-authored-by: Dmitry Vasliyev <dmitry.vasilyev@veeam.com>
(cherry picked from commit 3505dc3)
@vonzshik

vonzshik commented Feb 4, 2025

Copy link
Copy Markdown
Contributor

Backported to 9.0.3 via 7f241f2, 8.0.6 via 9b0f9a3

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.

Add support for postgresql type names with dots

4 participants