By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE
INSERT 0 4
| col1 | col2 | col2_filtered |
|---|---|---|
| some_string | {siblings:0, pets:1, have_friends:0} | {pets:1} |
| some_string | {siblings:1, pets:1, have_friends:0} | {siblings:1, pets:1} |
| some_string | {siblings:1, pets:2, have_friends:3} | {siblings:1, pets:2, have_friends:3} |
| some_string | {siblings:0, pets:0, have_friends:0} | {} |
SELECT 4