Search Postgresql Archives

Re: Array OUT columns in a record returned from a function

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

 



Ged <pgsql4gm@xxxxxxxxx> writes:
> SELECT
> 	q.id, q.name, q.summary, q.instructions, q.experience, q.notes,
> q.starts, q.ends
> ,	q.stage, st.description
> ,	q.series, r.name
> ,	COALESCE('../zones/' || q.zone, '../instances/' || q.instance)
> ,	COALESCE(z.name, i.name)
> INTO
> 	results.id
> ,	results.name
> ,       results.summary
> ,       results.instructions
> ,       results.experience
> ,       results.notes
> ,	results.starts[0]
> ,       results.ends
> ,       results.stage
> ,       results.warning
> ,       results.series
> ,       results.series_name
> ,       results.location
> ,       results.location_name
> FROM

I don't think an INTO target can be anything except a simple variable or
simple record field.  So the [0] is taken as part of the SQL query
rather than part of an INTO target, and it goes downhill from there.

Consider assigning that value to a temp variable and then assigning
into the desired result format.

			regards, tom lane


[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