Jak zapytać o wartości null w polu typu json postgresql?
Mam post typu json w postgresql. Nie mogę jednak wybrać wierszy, w których określone pole jest puste:
Kod:
SELECT *
FROM json_array_elements(
'[{"name": "Toby", "occupation": "Software Engineer"},
{"name": "Zaphod", "occupation": "Galactic President"} ,
{"name2": "Zaphod", "occupation2": null} ]' ) AS elem
where elem#>'{occupation2}' is null
Powinno to działać, ale otrzymuję ten błąd:
ERROR: operator does not exist: json #> boolean
LINE 6: where elem#>'{occupation2}' is null