Search Postgresql Archives

Re: How to stop array_to_json from interpolating column names that weren't there

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

 



Guyren Howe <guyren@xxxxxxxxx> writes:
> I have an array of perfect JSON objects. Now I just need to turn that into a single JSON object. But when I do the obvious:

> SELECT array_to_json(
> 		SELECT
> 			ARRAY_AGG(foo) AS foos
> 		FROM (
> 			SELECT
> 				row_to_json(schemata_)
> 			FROM
> 				schemata_)
> 			AS
> 				foo
> )

> I get a syntax error.

Well, yeah, you're missing parentheses around the scalar sub-select.
(Whether fixing that will give the behavior you want is unclear,
but the syntax error is clear.)

			regards, tom lane


-- 
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