On 27 March 2015 at 19:12, Eli Murray <ejmur...@illinimedia.com> wrote:

> I'm running psql --version 9.4.1
>
> Also, it may be worth noting that rawdata.deptname and rawdata.deptcode
> are both text data types.
>
> The errors I'm getting are:
>
> ERROR:  syntax error at or near "json_build_object"
> LINE 1: insert into json(data) json_build_object(SELECT DISTINCT dep...
>
> and
>
> ERROR:  syntax error at or near "row_to_json"
> LINE 1: insert into json(data) row_to_json(SELECT DISTINCT deptname,...
>
>
Yea, because the insert syntax is a little bit different, try this:

insert into json(data) SELECT json_build...
or
insert into json(data) SELECT row_to_json...

regards,
Szymon

Reply via email to