Skip to content

json_missing_element_default (string)

This configuration parameter is used to change the default behavior of ERROR ON ERROR when accessing missing elements in JSON documents. It accepts two values:

  • "null" (the default setting)
  • "error"
sql
set json_missing_element_default to 'null';
select '{"answer":42}':question;
-- <null>
sql
set json_missing_element_default to 'error';
select '{"answer":42}':question;
--ERROR:  No key found at path: 'strict $."question"' for '{"answer":42}'