Re: Custom Operators Cannot be Found for Composite Type Values

From: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Custom Operators Cannot be Found for Composite Type Values
Date: 2012-03-08 19:32:30
Message-ID: 0D0EEF3A-7767-4206-9FFB-85C484F49C42@justatheory.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mar 8, 2012, at 11:27 AM, Andrew Dunstan wrote:

> Yeah. Note too that this is at best dubious:
>
> CREATE OR REPLACE FUNCTION json_cmp(
> json,
> json
> ) RETURNS INTEGER LANGUAGE SQL STRICT IMMUTABLE AS $$
> SELECT bttextcmp($1::text, $2::text);
> $$;
>
>
> Two pieces of JSON might well be textually different but semantically identical (e.g. by one having additional non-semantic whitespace).

Yes. This is just for unit tests, and is fine for the moment. If I end up with abnormalities, I will likely rewrite json_cmp() in Perl and use JSON::XS to do normalization. Not needed yet, though.

Thanks,

David

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David E. Wheeler 2012-03-08 19:59:33 Re: regress bug
Previous Message David E. Wheeler 2012-03-08 19:31:19 Re: Custom Operators Cannot be Found for Composite Type Values