Search Postgresql Archives

Re: Array_to_json remove brackets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx> 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]', '[]');


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux