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:
create table items (id int primary key, tags text[]);
-- subscribe to items with filter tags=is.null, and to any other table without a filter
insert into items values (1, '{a}');
-- the other subscriber never gets its next change
#2099 and #2175 don't catch this.
Subscribing with a filter on an array column, e.g.
tags=is.nullon atext[]column, works fine (SUBSCRIBED). But as soon as a row changes in that table,list_changeserrors out: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 comparescol.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:
#2099 and #2175 don't catch this.