Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id C0263632BC6 for ; Fri, 31 Jul 2009 20:30:00 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 26980-10 for ; Fri, 31 Jul 2009 23:29:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.180]) by mail.postgresql.org (Postfix) with ESMTP id C1FDD6326BF for ; Fri, 31 Jul 2009 20:29:49 -0300 (ADT) Received: by wa-out-1112.google.com with SMTP id k34so392412wah.19 for ; Fri, 31 Jul 2009 16:29:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=WDdzTRrQD1aW7AkW6Q7aahXNmDoFMx47hJuoOCPiUvc=; b=oxxttP5dBfnmdaMwoc+gv9apoFNo6J0htA+bJb8uZSoiYOnmDZphkR9/2X5W7u8AJ/ 72J+6OFbuRAI+lctP3Ghf1Gwtq6wl/MfRqVFGos4yJKSW9RINFm7pA34Z+il03X2S0vq omJDG4UiCbPeCJaa+GDD5GJmOjbhPyRFGovW0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=wXEA8hoRhdmNWCrkujWoHw+m9XjqdD9oN/OW9ld3RgHjGpxh/CsM2DE6Qh02l3GMxU bVbfJPoAsZilji8Yh0jtxodaqHq2W0akzFdOuPdcexvX2859DSFMvlfeqEYYN3EcCkJb 2oIWMN1JEo08vPj5koyI8wrvbzE8t8mQUZYms= Received: by 10.114.111.13 with SMTP id j13mr3206316wac.222.1249082987921; Fri, 31 Jul 2009 16:29:47 -0700 (PDT) Received: from eddie (c-67-182-227-82.hsd1.ut.comcast.net [67.182.227.82]) by mx.google.com with ESMTPS id l37sm5891398waf.5.2009.07.31.16.29.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 31 Jul 2009 16:29:46 -0700 (PDT) Date: Fri, 31 Jul 2009 17:29:35 -0600 From: Joshua Tolley To: Andreas Cc: pgsql-sql@postgresql.org Subject: Re: How fetch multiple rows into one text-field? Message-ID: <20090731232935.GZ4385@eddie> References: <4A734F8A.906@gmx.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="B2XwZuBUJ8PPSpsy" Content-Disposition: inline In-Reply-To: <4A734F8A.906@gmx.net> User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.01 tagged_above=-10 required=5 tests=AWL=0.010 X-Spam-Level: X-Archive-Number: 200907/168 X-Sequence-Number: 32909 --B2XwZuBUJ8PPSpsy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 =20 > show in a report. It sounds like you might want something like this: SELECT ... array_to_string(array_accum(log_notes, '')) FROM= =2E.. 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 --B2XwZuBUJ8PPSpsy Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkpzfl8ACgkQRiRfCGf1UMNXrQCgmgTPn18Xx0BU3ahSExPrK/Zn 9kMAmQFz0mp72c/rJRFIR7VBI/HOMqo5 =eRpL -----END PGP SIGNATURE----- --B2XwZuBUJ8PPSpsy--