Re: idea: allow AS label inside ROW constructor
От
Andrew Dunstan
Тема
Re: idea: allow AS label inside ROW constructor
Дата
Msg-id
54490526.5060903@dunslane.net
Ответ на
Re: idea: allow AS label inside ROW constructor (Merlin Moncure)
Список
Дерево обсуждения
idea: allow AS label inside ROW constructor Pavel Stehule <pavel.stehule@gmail.com>
Re: idea: allow AS label inside ROW constructor Pavel Stehule <pavel.stehule@gmail.com>
Re: idea: allow AS label inside ROW constructor Merlin Moncure <mmoncure@gmail.com>
Re: idea: allow AS label inside ROW constructor Pavel Stehule <pavel.stehule@gmail.com>
Re: idea: allow AS label inside ROW constructor Pavel Stehule <pavel.stehule@gmail.com>
Re: idea: allow AS label inside ROW constructor Merlin Moncure <mmoncure@gmail.com>
Re: idea: allow AS label inside ROW constructor Andrew Dunstan <andrew@dunslane.net>
Re: idea: allow AS label inside ROW constructor Merlin Moncure <mmoncure@gmail.com>
Re: idea: allow AS label inside ROW constructor Florian Pflug <fgp@phlo.org>
Re: idea: allow AS label inside ROW constructor Andrew Dunstan <andrew@dunslane.net>
Re: idea: allow AS label inside ROW constructor David G Johnston <david.g.johnston@gmail.com>
Re: idea: allow AS label inside ROW constructor Andrew Dunstan <andrew@dunslane.net>
Re: idea: allow AS label inside ROW constructor David Johnston <david.g.johnston@gmail.com>
Re: idea: allow AS label inside ROW constructor Pavel Stehule <pavel.stehule@gmail.com>
On 10/23/2014 09:27 AM, Merlin Moncure wrote:
> On Thu, Oct 23, 2014 at 4:34 AM, Pavel Stehule wrote:
>> Hi
>>
>> here is a prototype
>>
>> postgres=# select row_to_json(row(10 as A, row(30 as c, 20 AS B) as x));
>> row_to_json
>> ------------------------------
>> {"a":10,"x":{"c":30,"b":20}}
>> (1 row)
>>
>> postgres=# select row_to_json(row(10, row(30, 20)));
>> row_to_json
>> ----------------------------------
>> {"f1":10,"f2":{"f1":30,"f2":20}}
>> (1 row)
> wow -- this is great. I'll take a a look.
>
Already in 9.4:
andrew=# select
json_build_object('a',10,'x',json_build_object('c',30,'b',20)); json_build_object
---------------------------------------- {"a" : 10, "x" : {"c" : 30, "b" : 20}}
(1 row)
So I'm not sure why we want another mechanism unless it's needed in some
other context.
cheers
andrew
В списке pgsql-hackers по дате отправления