Re: Array_to_json remove brackets

Поиск
Список
Период
Сортировка
От Leonardo M. Ramé
Тема Re: Array_to_json remove brackets
Дата
Msg-id 5645EC92.1070801@griensu.com
обсуждение исходный текст
Ответ на Re: Array_to_json remove brackets  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-general
El 13/11/15 a las 10:49, Merlin Moncure escribió:
> On Fri, Nov 13, 2015 at 7:20 AM, Leonardo M. Ramé <l.rame@griensu.com> wrote:
>> Hi, is there a way to get an array converted to json without brackets?.
>>
>> I'm getting, for example [{"field": "value"}, {"field": "value"}] and I want
>> to get this: {"field": "value"}, {"field": "value"}.
>
> please supply an example.  Also,
> {"field": "value"}, {"field": "value"}
>
> is not valid json, so, basically, no.  But you could textually remove
> them I guess but I'm thinking more context is needed to give a better
> answer.
>
> merlin
>
>

Thanks, I fixed this with a simple trim command:

select trim('[abcd]', '[]');


В списке pgsql-general по дате отправления:

Предыдущее
От: "Doiron, Daniel"
Дата:
Сообщение: Re: Does PostgreSQL ever create indexes on its own?
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: