On Wed, May 11, 2016 at 9:09 PM, David E. Wheeler <da...@justatheory.com> wrote: > > On May 11, 2016, at 11:01 AM, Fabrízio de Royes Mello < fabriziome...@gmail.com> wrote: > > > I know... but you can do that just in case the current behaviour fail by cathing it with "begin...exception...", so you'll minimize the looking for process on catalog. > > Yeah, I guess. Honestly 90% of this issue would go away for me if there was a `json = json` operator. I know there are a couple different ways to interpret JSON equality, though. >
Yeah.. it's ugly but you can do something like that: CREATE OR REPLACE FUNCTION json_equals_to_json(first JSON, second JSON) RETURNS boolean AS $$ BEGIN RETURN first::TEXT IS NOT DISTINCT FROM second::TEXT; END $$ LANGUAGE plpgsql IMMUTABLE; CREATE OPERATOR = ( LEFTARG = json, RIGHTARG = json, PROCEDURE = json_equals_to_json ); Regards, -- Fabrízio de Royes Mello Consultoria/Coaching PostgreSQL >> Timbira: http://www.timbira.com.br >> Blog: http://fabriziomello.github.io >> Linkedin: http://br.linkedin.com/in/fabriziomello >> Twitter: http://twitter.com/fabriziomello >> Github: http://github.com/fabriziomello