Re: Does Type Have = Operator? - Mailing list pgsql-hackers

From David E. Wheeler
Subject Re: Does Type Have = Operator?
Date
Msg-id E34AEE59-C76B-4691-AEB1-4F79E6788821@justatheory.com
Whole thread Raw
In response to Re: Does Type Have = Operator?  (Fabrízio de Royes Mello <fabriziomello@gmail.com>)
Responses Re: Does Type Have = Operator?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On May 12, 2016, at 11:19 AM, Fabrízio de Royes Mello <fabriziomello@gmail.com> wrote:

> Yeah.. it's ugly but you can do something like that:

I could, but I won’t, since this is pgTAP and users of the library might have defined their own json operators.

Andrew Dunstan has done the yeoman’s work of creating such operators, BTW:
 https://bitbucket.org/adunstan/jsoncmp

Some might argue that it ought to compare JSON objects, effectively be the equivalent of ::jsonb = ::jsonb, rather than
::text= ::text. But as Andrew points out to me offlist, “if that's what they want why aren't they using jsonb in the
firstplace?” 

So I think that, up to the introduction of JSONB, it was important not to side one way or the other and put a JSON =
operatorin core. But now what we have JSONB, perhaps it makes sense to finally take sides and intoduce JSON = that does
plaintext comparison. Thoughts? 

Best,

David

pgsql-hackers by date:

Previous
From: Fabrízio de Royes Mello
Date:
Subject: Re: Does Type Have = Operator?
Next
From: Alvaro Herrera
Date:
Subject: Re: Use %u to print user mapping's umid and userid