[SQL] Concatenate results of a single column query

2004-04-19 Thread Marco Lazzeri
Hi All, I would like to concatenate results of a single column query, something like the futurable (dev docs for 7.5) SELECT p.name, ARRAY(SELECT nicknames FROM people WHERE people.id = p.id) FROM people AS p Any suggestions? Thanks Marco ---(end of broadcast)

Re: [SQL] Concatenate results of a single column query

2004-04-19 Thread CoL
hi, Christoph Haller wrote: Interesting feature, but I cannot find function array_append: ERROR: AggregateCreate: function array_append(integer[], integer) does not exist try with pg 7.4 C. ---(end of broadcast)--- TIP 9: the planner will ignore

Re: [SQL] Concatenate results of a single column query

2004-04-19 Thread Greg Stark
Christoph Haller <[EMAIL PROTECTED]> writes: > Interesting feature, but I cannot find function array_append: > ERROR: AggregateCreate: function array_append(integer[], integer) does not exist It's new in Postgres 7.4 I think you could do this in 7.3 though, it would just be more awkward. Try |

Re: [SQL] Concatenate results of a single column query

2004-04-19 Thread Christoph Haller
> > > Marco Lazzeri <[EMAIL PROTECTED]> writes: > > > SELECT > > p.name, ARRAY(SELECT nicknames FROM people WHERE people.id = p.id) > > FROM people AS p > > > Any suggestions? > > Something like: > > db=> create aggregate array_aggregate (basetype = integer, sfunc = array_append, > stype =

Re: [SQL] Concatenate results of a single column query

2004-04-18 Thread Greg Stark
Marco Lazzeri <[EMAIL PROTECTED]> writes: > SELECT > p.name, ARRAY(SELECT nicknames FROM people WHERE people.id = p.id) > FROM people AS p > Any suggestions? Something like: db=> create aggregate array_aggregate (basetype = integer, sfunc = array_append, stype = integer[], initcond = '{}');

[SQL] Concatenate results of a single column query

2004-04-18 Thread Marco Lazzeri
Hi All, I would like to concatenate results of a single column query using PostgreSQL 7.3. Something like the coming feature SELECT p.name, ARRAY(SELECT nicknames FROM people WHERE people.id = p.id) FROM people AS p (devel docs for 7.5: http://developer.postgresql.org/docs/postgres/sql-express