Skip to content

Inconsistent load of domain type into DatabaseInfo #6367

@inoa-pmattos

Description

@inoa-pmattos

When using npgsql with Babelfish, most of the domain types defined by the Babelfish extension are loaded in the DatabaseInfo dictionaries.
But sys.decimal seems to be exceptional and is not loaded.

This is causing me problems when using BeginBinaryImportAsync and calling Write and passing sys.decimal as dataTypeName, and results an exception:

The data type name `sys.decimal` could not be found in the types that were loaded by Npgsql. Your database details or Npgsql type loading configuration may be incorrect.

While debugging I noticed a sys.numeric was loaded and it matches the OID expected for sys.decimal:

Image Image

When querying pg_type for numeric I don't see any results , so I assume npgsql extract the name some other way and we endup with sys.numeric
I think it may caused by some special handling in Babelfish to treat sys.decimal and sys.numeric as the same type since in mssql the types are essencially the same.

For now I will just change my code to force to use sys.numeric when the datatypeName is sys.decimal, but would be nice if npgsql could this internally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions