Skip to content

Full text query parse issue #282

Description

@jjxtra

I am comparing behavior of the NpgsqlTypes.NpgsqlTsQuery.Parse(_query); vs just passing in my raw query string using EF.Functions.ToTsQuery(_query).

The short of the problem is that EF.Functions.ToTsQuery(_query) behaves as expected, while NpgsqlTypes.NpgsqlTsQuery.Parse(_query) seems to be stacking terms separated by | operators in a weird way and does not retrieve expected results on the server.

Is the syntax for NpgsqlTypes.NpgsqlTsQuery.Parse(_query) different from EF.Functions.ToTsQuery(_query)?

Activity

  1. roji commented on Jan 26, 2023

    @roji
    Member

    @jjxtra NpgsqlTsQuery.Parse aims to be a compatible C# implementation of the PostgreSQL parsing logic. This is something that Npgsql used to do, which we generally no longer believe is a good idea: the database driver should not be replicating complex database textual representation parsing logic, and this kind of bug is a good example why.

    We've generally been removing client-side parsing (e.g. see #4902), I believe we should remove this as well. In the meantime, I highly recommend avoiding NpgsqlTsQuery.Parse and only using ToTsQuery, which ensures that PostgreSQL is the one doing the parsing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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