From: | Craig Ringer <ringerc(at)ringerc(dot)id(dot)au> |
---|---|
To: | Greg Hazel <ghazel(at)gmail(dot)com> |
Cc: | pgsql-bugs(at)postgresql(dot)org |
Subject: | Re: BUG #7620: array_to_json doesn't support heterogeneous arrays |
Date: | 2012-10-28 07:30:54 |
Message-ID: | 508CDF2E.7060305@ringerc.id.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
On 10/24/2012 11:46 PM, Greg Hazel wrote:
> Another option that just occurred to me is a new function (say, to_json) that converts the parameter to its json representation, with type json.
>
> Then this would be possible:
>
> select array_to_json(ARRAY[to_json('foo'), to_json(100), to_json(true)]);
That's been repeatedly discussed (and requested, and had patches posted)
on -hackers. Right now the standing opinion appears to be that "json"
represents a whole json document, and json documents must be arrays or
JavaScript objects, not scalars, so it is not valid to provide a scalar
"to_json".
I posted patches to support this functionality - as did several others
as it turns out - and they've all been rejected.
--
Craig Ringer
From | Date | Subject | |
---|---|---|---|
Next Message | tixu | 2012-10-28 07:35:36 | BUG #7624: Misleading Log Message & Inconsistent Configuration Design |
Previous Message | louis-claude.canon | 2012-10-26 19:15:58 | BUG #7623: Inconsistency on transaction isolation documentation |