SELECT json_get('{"key": "value", "key2": "value2"}', 'key'); json_get ---------- "value" (1 row) SELECT json_get('{"key": "value", "key": "value2"}', 'key'); ERROR: JSONPath expression matched multiple results /* These each return no result because 0 is a number (indicating a numeric subscript), not a string (indicating an object subscript). */ SELECT json_get('{"0": "value", "key": "value"}', '0'); json_get ---------- (1 row) SELECT json_get('{"0": "value", "0": "value"}', '[0]'); json_get ---------- (1 row) SELECT json_get('{"0": "value", "0": "value"}', '.0'); json_get ---------- (1 row) SELECT json_get('{"0": "value", "1": "value"}', '["0"]'); json_get ---------- "value" (1 row) SELECT json_get('{"0": "value", "0": "value"}', '["0"]'); ERROR: JSONPath expression matched multiple results SELECT json_get('[0,1,2,3]', '0'); json_get ---------- 0 (1 row) SELECT json_get('[0,1,2,3]', '"0"'); json_get ---------- (1 row) SELECT json_get('[0,1,2,3]', '*'); ERROR: JSONPath expression matched multiple results SELECT json_get('[0]', '*'); json_get ---------- 0 (1 row) SELECT json_get('[[0]]', '..*'); ERROR: JSONPath expression matched multiple results