pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joshua Tolley <eggyknap@gmail.com>
To: Andreas <maps.on@gmx.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: How fetch multiple rows into one text-field?
Date: Fri, 31 Jul 2009 17:29:35 -0600
Message-ID: <20090731232935.GZ4385@eddie> (raw)
In-Reply-To: <4A734F8A.906@gmx.net>
References: <4A734F8A.906@gmx.net>

On Fri, Jul 31, 2009 at 10:09:46PM +0200, Andreas wrote:
> Hi,
>
> how can I fetch multiple rows into one text-field?
> I need the contents of some log-infos condensed into a single text to  
> show in a report.

It sounds like you might want something like this:

SELECT ... array_to_string(array_accum(log_notes, '<some delimiter>')) FROM...

You might need to add array_accum manually; before 8.4 it wasn't built in.
See http://www.postgresql.org/docs/8.3/static/xaggr.html

--
Joshua Tolley / eggyknap
End Point Corporation
http://www.endpoint.com

Attachments:

  signature.asc (application/pgp-signature, 196B) download

view thread (2+ messages)

Message-ID: <20090731232935.GZ4385@eddie>
Permalink:  ../20090731232935.GZ4385@eddie/
Also on:    postgresql.org/message-id/20090731232935.GZ4385@eddie

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: eggyknap@gmail.com, maps.on@gmx.net
  Subject: Re: How fetch multiple rows into one text-field?
  In-Reply-To: <20090731232935.GZ4385@eddie>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox