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