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

tsvector not recomputed when a NULL column is set to a value. #5

Open
dasmoth opened this issue Feb 1, 2019 · 0 comments
Open

tsvector not recomputed when a NULL column is set to a value. #5

dasmoth opened this issue Feb 1, 2019 · 0 comments

Comments

@dasmoth
Copy link

dasmoth commented Feb 1, 2019

I believe there is a bug in the generated trigger logic. If a NULL column is given a non-NULL value, this won't trigger an update to the tsvector field to include the new text.

The issue is with logic like:

     ELSIF (NEW."some_indexed_field" <> OLD."some_indexed_field") THEN do_update = true;

Since NULL <> 'something' is not true in SQL. The simplest solution I could come up with is to replace the <> tests with IS DISTINCT FROM.

Let me know if you'd like a pull request.

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

1 participant