I have a table with citext columns where the citext extension is installed in a custom "extensions" schema, running on PostgreSQL 14.4.
CREATE EXTENSION citext
SCHEMA "extensions"
Relevant table DDL snippet:
CREATE TABLE foo.sample (
id int4 NOT NULL GENERATED BY DEFAULT AS IDENTITY,
created_by extensions.citext NOT NULL,
.
.
.
);
ModelBuilder (for reference)
modelBuilder
.HasDefaultSchema("foo")
.HasPostgresExtension("extensions","citext");
After upgrading to 6.0.5, querying the table throws a System.NotSupportedException related to the citext type:
The field 'created_by' has type 'extensions.citext', which is currently unknown to Npgsql
After downgrading the nuget package to 6.0.4, the query works as expected.
Full Exception:
An exception occurred while iterating over the results of a query for context type 'Demo.Models.TestDbContext'.
System.NotSupportedException: The field 'created_by' has type 'extensions.citext', which is currently unknown to Npgsql. You can retrieve it as a string by marking it as unknown, please see the FAQ.
at Npgsql.Internal.TypeHandlers.UnknownTypeHandler.Read(NpgsqlReadBuffer buf, Int32 byteLen, Boolean async, FieldDescription fieldDescription)
at Npgsql.NpgsqlDataReader.GetFieldValue[T](Int32 ordinal)
at lambda_method43(Closure , DbDataReader , Int32[] )
at Microsoft.EntityFrameworkCore.Query.Internal.BufferedDataReader.BufferedDataRecord.ReadObject(DbDataReader reader, Int32 ordinal, ReaderColumn column)
at Microsoft.EntityFrameworkCore.Query.Internal.BufferedDataReader.BufferedDataRecord.ReadRow()
at Microsoft.EntityFrameworkCore.Query.Internal.BufferedDataReader.BufferedDataRecord.Initialize(DbDataReader reader, IReadOnlyList`1 columns)
at Microsoft.EntityFrameworkCore.Query.Internal.BufferedDataReader.Initialize(IReadOnlyList`1 columns)
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReader(RelationalCommandParameterObject parameterObject)
at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.Enumerator.InitializeReader(Enumerator enumerator)
at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.<>c__DisplayClass31_0`2.<Execute>b__0(DbContext context, TState state)
at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementation[TState,TResult](Func`3 operation, Func`3 verifySucceeded, TState state)
at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.Enumerator.MoveNext()
I have a table with citext columns where the citext extension is installed in a custom "extensions" schema, running on PostgreSQL 14.4.
Relevant table DDL snippet:
ModelBuilder (for reference)
After upgrading to 6.0.5, querying the table throws a System.NotSupportedException related to the citext type:
After downgrading the nuget package to 6.0.4, the query works as expected.
Full Exception: