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