[PostgreSQL] SQL Error [22023]: 오류: 스칼라형에서는 json_array_elements 호출 할 수 없음. json의 null값 제거 방법
json/jsonb 타입의 컬럼의 json 컨텐츠에서 array 값을 가지는 특정 property를 행으로 가져올 때 from 절에 json_array_elements 혹은 jsonb_array_elements 함수를 사용합니다. select * from json_array_elements(('{ "Cities": [ "Seoul", "Busan", "Daegu" ]}'::json) -> 'Cities') 하지만 만일 Cities가 null 일 경우 해당 쿼리를 실행하면 scalar type 값에 json_array_elements를 호출 할 수 없다는 오류를 뿜어냅니다. select * from json_array_elements(('{ "Cities": null }'::json) -> 'Cities'..