Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X9dtW-0001s2-GG for pgsql-bugs@arkaria.postgresql.org; Tue, 22 Jul 2014 17:30:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1X9dtW-00081q-0n for pgsql-bugs@arkaria.postgresql.org; Tue, 22 Jul 2014 17:30:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X9Xqd-0002lw-CS for pgsql-bugs@postgresql.org; Tue, 22 Jul 2014 11:03:07 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X9XqZ-0003HK-CJ for pgsql-bugs@postgresql.org; Tue, 22 Jul 2014 11:03:06 +0000 MIME-Version: 1.0 Subject: BUG #11021: How to extract text value from json scalar? To: pgsql-bugs@postgresql.org From: kolmyk@hotmail.com Date: Tue, 22 Jul 2014 11:02:27 +0000 Message-ID: <20140722110227.27769.66551@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.2 (-) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 11021 Logged by: Alexey Email address: kolmyk@hotmail.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"}'); -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs