Re: Building JSON objects - Mailing list pgsql-general

From David G. Johnston
Subject Re: Building JSON objects
Date
Msg-id CAKFQuwbmC7F6D+_Vdwo5RRcgxXXOVyWsYJXJMLTK1z3upL09oQ@mail.gmail.com
Whole thread Raw
In response to Re: Building JSON objects  (Jan de Visser <jan@de-visser.net>)
Responses Re: Building JSON objects
List pgsql-general
On Fri, Mar 27, 2015 at 11:31 AM, Jan de Visser <jan@de-visser.net> wrote:
On March 27, 2015 01:12:52 PM Eli Murray wrote:
> ERROR:  syntax error at or near "json_build_object"
> LINE 1: insert into json(data) json_build_object(SELECT DISTINCT dep...

You may want to review the syntax of the INSERT command, i.e. this doesn't
have anything to do with JSON:

INSERT INTO foo ( bar, baz, quux, froz ) VALUES (NULL, 12, 'box', now())


​or..

INSERT INTO json(data) SELECT json_build_object(SELECT DISTINCT dep...)

​David J.

pgsql-general by date:

Previous
From: Arthur Silva
Date:
Subject: Re: json-patch support?
Next
From: Merlin Moncure
Date:
Subject: Re: json-patch support?