This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION json_cmp(left json, right json) | |
RETURNS integer AS $$ | |
select bttextcmp($1::text, $2::text) | |
$$ LANGUAGE sql IMMUTABLE STRICT; | |
CREATE OR REPLACE FUNCTION json_eq(json, json) | |
RETURNS BOOLEAN LANGUAGE SQL STRICT IMMUTABLE AS $$ | |
SELECT json_cmp($1, $2) = 0; | |
$$; | |