Skip to content

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

@dasmoth

Description

@dasmoth

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.

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