There are cases where JSON columns are expected to be arrays, and our policy queries then use JSONB_ARRAY_ELEMENTS to extract the elements. However, if the returned value from AWS is null, we write null into the column, rather than an empty array. When this happens, JSONB_ARRAY_ELEMENTS fails. We could, instead, choose to write an empty array in such cases. This would make policy queries simpler, as we wouldn't need to have a switch case on null instances. I'm not sure whether we should do this from a philosophical standpoint though.
See this ticket for additional context: #3565 (comment)
There are cases where JSON columns are expected to be arrays, and our policy queries then use
JSONB_ARRAY_ELEMENTSto extract the elements. However, if the returned value from AWS is null, we writenullinto the column, rather than an empty array. When this happens,JSONB_ARRAY_ELEMENTSfails. We could, instead, choose to write an empty array in such cases. This would make policy queries simpler, as we wouldn't need to have a switch case on null instances. I'm not sure whether we should do this from a philosophical standpoint though.See this ticket for additional context: #3565 (comment)