I want to check as a constraint if the root keys of a jsonb document consists of any text elements like array['likes','interests','activities','movies','music','television']
create table foo(
bar_json jsonb,
constraint baz check(jsonb_object_keys(bar_json)::text[] @> array['likes','interests','activities','movies','music','television'])
);
The one above doesn't work. Can you help me? Thank you!