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
On Mar 8, 2012, at 11:16 AM, Tom Lane wrote:
>> This seems to work.
>
> Urk. You really ought to provide the whole opclass (all 5 operators).
> I'm not sure what will blow up if you leave it like that, but it won't
> be pretty.
Yes, I expect to have to fill in gaps as I go. These are just for u
On 03/08/2012 02:16 PM, Tom Lane wrote:
"David E. Wheeler" writes:
CREATE OPERATOR CLASS json_ops
DEFAULT FOR TYPE JSON USING btree AS
OPERATOR3 = (json, json),
FUNCTION1 json_cmp(json, json);
This seems to work.
Urk. You really ought to provide the whole op
"David E. Wheeler" writes:
> CREATE OPERATOR CLASS json_ops
> DEFAULT FOR TYPE JSON USING btree AS
> OPERATOR3 = (json, json),
> FUNCTION1 json_cmp(json, json);
> This seems to work.
Urk. You really ought to provide the whole opclass (all 5 operators).
I'm not sure
On Mar 7, 2012, at 8:23 PM, Tom Lane wrote:
> You have not told the system that your operator is equality for the
> datatype. It's just a random operator that happens to be named "=".
> We try to avoid depending on operator names as cues to semantics.
>
> You need to incorporate it into a defaul
"David E. Wheeler" writes:
> Im doing some development with the new JSON type (actually, Andrews
> backport to 9.1) and needed to do some very basic equivalence testing. So I
> created a custom operator:
> CREATE OR REPLACE FUNCTION json_eq(
> json,
> json
> ) RETURNS
Hackers,
I’m doing some development with the new JSON type (actually, Andrew’s backport
to 9.1) and needed to do some very basic equivalence testing. So I created a
custom operator:
CREATE OR REPLACE FUNCTION json_eq(
json,
json
) RETURNS BOOLEAN LANGUAGE SQL STRICT IMMU