Re: 9.3: bug related to json

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Torsten Förtsch <torsten(dot)foertsch(at)gmx(dot)net>
Cc: David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: 9.3: bug related to json
Date: 2015-02-25 13:25:33
Message-ID: 29767.1424870733@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

=?UTF-8?B?VG9yc3RlbiBGw7ZydHNjaA==?= <torsten(dot)foertsch(at)gmx(dot)net> writes:
> On 25/02/15 07:34, David G Johnston wrote:
>> Torsten Frtsch wrote
>>> Is there anything similar for JSON scalars?
>> IDK, but have you tried "::text"?

> yes. Here is the difference
> select * from (values (('{"a":"b"}'::json -> 'a')::text),
> ('{"a":"b"}'::json ->> 'a')) t;
> column1
> ---------
> "b"
> b

As of 9.4, there's a function json_array_elements_text()
which does what I think you're looking for.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Felix Ivan Romero Rodríguez 2015-02-25 15:11:06 utf8 issues
Previous Message JD 2015-02-25 11:50:25 : :Full text search query ::