Skip to content

Discussion: Should we write nulls into JSON columns that are expected to be arrays? #3724

@hermanschaaf

Description

@hermanschaaf

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)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions