I am trying to create a recursive JSON equality operator. Right now the trouble is that for some reason when I type out a JSON literal in a PL-PGSQL anonymous block for testing, it constantly throws an illegal array element syntax error.
Below is my current code.
DO $$
DECLARE
keys1 text[];
keys2 text[];
json1 json;
BEGIN
json1 := '{"a5":16,"b2":14}'::json;
SELECT * FROM json_object_keys(json1) into keys1;
END
$$;