Re: PATCH: Add hstore_to_json()

From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PATCH: Add hstore_to_json()
Date: 2010-01-04 03:21:29
Message-ID: F9692CDB-715E-4F47-95D3-577E643A845E@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Jan 3, 2010, at 4:18 PM, Hitoshi Harada wrote:

> That sounds good and seems possible, as far as operator returns JSON
> always. Perhaps every JSON fetching returns JSON even if the result
> would be a number. You can cast it.
>
> % SELECT ('{"foo":{"bar":["a","b","c"]}}' -> '["foo"][1]')::text;
> 1
> -----
> b

No, because 'b' isn't valid JSON. So if we want an interface that returns scalars, they can't be JSON.

Best,

David

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-01-04 03:26:20 Re: PATCH: Add hstore_to_json()
Previous Message Robert Haas 2010-01-04 03:19:33 Re: Buffer statistics for pg_stat_statements