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
{{ message }}
Repository navigation
Filter on an array column breaks postgres_changes for the whole project #2361
Subscribing with a filter on an array column, e.g. tags=is.null on a text[] column, works fine (SUBSCRIBED). But as soon as a row changes in that table, list_changes errors out:
ERROR: malformed array literal: "["a"]"
The whole batch gets dropped, so every other subscriber in the project misses those changes too, even unfiltered ones on other tables.
The cause is in is_visible_through_filters: it compares col.value #>> '{}', which is the jsonb text (["a"]), not the Postgres literal ({a}). The same happens with composite types and jsonb columns holding a string.
Quick repro:
createtableitems (id intprimary key, tags text[]);
-- subscribe to items with filter tags=is.null, and to any other table without a filterinsert into items values (1, '{a}');
-- the other subscriber never gets its next change
Activity
fix: evaluate postgres_changes filters against the raw wal2json values
fix: evaluate postgres_changes filters against the raw wal2json values
fix: evaluate postgres_changes filters against the raw wal2json values