BUG #11021: How to extract text value from json scalar?

From: kolmyk(at)hotmail(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #11021: How to extract text value from json scalar?
Date: 2014-07-22 11:02:27
Message-ID: 20140722110227.27769.66551@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 11021
Logged by: Alexey
Email address: kolmyk(at)hotmail(dot)com
PostgreSQL version: 9.3.4
Operating system: Windows 8.0
Description:

I'm using json_each function for iterate keys and values in my function, but
string values contains quotes.
I can use json_each_text, but sometimes I need to json value.
Can I extract text value from json scalar?

Now I'm using this alternative script:
('[' || value ||']')::json->>0

Example:
select key, value, ('[' || value ||']')::json->>0 from
json_each('{"a":123,"b":"first"}');

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2014-07-22 13:09:31 Re: pg_upgrade < 9.3 -> >=9.3 misses a step around multixacts
Previous Message Andres Freund 2014-07-22 09:27:51 Re: pg_upgrade < 9.3 -> >=9.3 misses a step around multixacts