-
Notifications
You must be signed in to change notification settings - Fork 920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Schema validation not working with NpgSql v5 #2876
Comments
Duplicate of #1895 |
For me it is not the same than #1895. Validation was mostly working with Npgsql prior to its v5, and #1895 is about some of the few cases it did not. But validation with Npgsql does mostly not work anymore from its v5 version, due to a large change in the retrieved types naming. It may still be closed, but more for a reason like external issue, if such a driver behavior is not something NHibernate is meant to take into account. |
@fredericDelaporte but the reason is exactly same. This way or another these tickets are duplicates. Maybe we should close the other one as a duplicate? |
Ok, going to fix separately to #1895 |
Fixed by #2992. |
Database schema auto validation is not working after the update of NpgSql to version 5.0.0.
(Enabled e.g by:
properties.SchemaAction = SchemaAutoAction.Validate;
)The validation always fails with errors like:
Exception stack:
Problem description:
The code in Table.cs
Table.ValidateColumns
https://github.com/nhibernate/nhibernate-core/blob/master/src/NHibernate/Mapping/Table.cs
is comparing column types:
The
columnInfo.TypeName
is getting column type from NpgSqlNpgsqlSchema.GetColumns
https://github.com/npgsql/npgsql/blob/main/src/Npgsql/NpgsqlSchema.cs
where the value is taken from
data_type
column from SQL query:Unfortunately in version 5.0.0, there were npgsql/npgsql#3012, which changed the returned value from
udt_name AS data_type
toudt_name::regtype::text AS data_type
.npgsql/npgsql@9036668#diff-9e5577d0cfb25bc8279488c960f8dc2427d580f90156386cda9d14953caafd1d
This change caused, that "user-facing type names" are now returned from the database.
Here are some example results returned from SQL query:
Please, fix this issue.
The text was updated successfully, but these errors were encountered: