Skip to content
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

Full text query parse issue #282

Open
jjxtra opened this issue Jan 25, 2023 · 1 comment
Open

Full text query parse issue #282

jjxtra opened this issue Jan 25, 2023 · 1 comment

Comments

@jjxtra
Copy link

jjxtra commented Jan 25, 2023

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)?

@roji
Copy link
Member

roji commented Jan 26, 2023

@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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants