You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Npgsql.PostgresException (0x80004005): XX000: malformed tsquery: operand not found
at Npgsql.NpgsqlConnector.<>c__DisplayClass161_0.<<ReadMessage>g__ReadMessageLong|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Npgsql.NpgsqlConnector.<>c__DisplayClass161_0.<<ReadMessage>g__ReadMessageLong|0>d.MoveNext() in C:\projects\npgsql\src\Npgsql\NpgsqlConnector.cs:line 1032
--- End of stack trace from previous location where exception was thrown ---
at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming) in C:\projects\npgsql\src\Npgsql\NpgsqlDataReader.cs:line 445
at Npgsql.NpgsqlCommand.ExecuteDbDataReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken) in C:\projects\npgsql\src\Npgsql\NpgsqlCommand.cs:line 1215
at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteAsync(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues, CancellationToken cancellationToken)
Actually, this is reproducible with the ADO.NET driver:
usingvarconn=context.Database.GetDbConnection();usingvarcmd=(NpgsqlCommand)conn.CreateCommand();cmd.CommandText="SELECT ts_rank_cd(to_tsvector('a b c'), @p0)";cmd.Parameters.AddWithValue("p0",NpgsqlDbType.TsQuery,newNpgsqlTsQueryEmpty());cmd.ExecuteScalar();
Though, even if that worked, it appears that this would still fail due to missing entries for NpgsqlTsQuery{Empty,And,...} in NpgsqlTypeMappingSource:
Activity
austindrenski commentedon May 17, 2019
@ljani Thanks for reporting this. I'm able to reproduce this (and a related bug) in our test suite. Looking into a patch shortly.
austindrenski commentedon May 17, 2019
Actually, this is reproducible with the ADO.NET driver:
Though, even if that worked, it appears that this would still fail due to missing entries for
NpgsqlTsQuery{Empty,And,...}inNpgsqlTypeMappingSource:https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/blob/d86bd4eff553d9a65713d8a1d2e84a41791f5a8b/src/EFCore.PG/Storage/Internal/NpgsqlTypeMappingSource.cs#L238-L242
Reproduced in austindrenski/Npgsql.EntityFrameworkCore.PostgreSQL/tree/issue-886.
/cc @roji @rwasef1830
ljani commentedon May 17, 2019
Thanks for looking into this. One request though: maybe release 2.2.3 soon? 😄
roji commentedon Oct 22, 2026
This actually seems to be a PostgreSQL bug; filed this as https://www.postgresql.org/message-id/flat/19778-1befc1fba593ab1b%40postgresql.org with a C libpq-only repro. Closing here.