Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 55D88133616B for ; Fri, 28 Jan 2011 07:42:32 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 67296-03 for ; Fri, 28 Jan 2011 11:42:25 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.scanlab.de (mail.scanlab.de [62.138.55.241]) by mail.postgresql.org (Postfix) with ESMTP id 760551337B79 for ; Fri, 28 Jan 2011 07:42:23 -0400 (AST) Received: from unknown (HELO Exchange-Server.scanlab-intern.de) ([172.16.20.15]) by mail.scanlab-intern.de with ESMTP; 28 Jan 2011 12:42:19 +0100 Received: from Exchange-Server.scanlab-intern.de ([127.0.0.1]) by Exchange-Server ([127.0.0.1]) with mapi; Fri, 28 Jan 2011 12:42:19 +0100 From: Andreas Gaab To: "pgsql-sql@postgresql.org" Date: Fri, 28 Jan 2011 12:42:18 +0100 Subject: aggregation of setof Thread-Topic: aggregation of setof Thread-Index: Acu+4GsEJv1OP8BcSm+4yFBK9dW2VQ== Message-ID: <48DA836F3865C54B8FBF424A3B775AF60132434B4A@Exchange-Server> Accept-Language: de-DE Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: de-DE Content-Type: multipart/alternative; boundary="_000_48DA836F3865C54B8FBF424A3B775AF60132434B4AExchangeServe_" MIME-Version: 1.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.909 tagged_above=-5 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201101/113 X-Sequence-Number: 35060 --_000_48DA836F3865C54B8FBF424A3B775AF60132434B4AExchangeServe_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi all, I would like to write a query, which aggregates the results of regexp_match= es(). The problem is that regexp_matches returnes setof text[] as documente= d even if I discard the global flag (http://www.postgresql.org/docs/8.4/sta= tic/functions-matching.html#FUNCTIONS-POSIX-REGEXP ). Thus resulting in an = error when I try to aggregate the result: " SELECT array_accum( regexp_matches('foobarbequebazilbarfbonk', '(b[^b]+)(b[^b]+)') ) ------------------------------- ERROR: set-valued function called in context that cannot accept a set ********** Fehler ********** ERROR: set-valued function called in context that cannot accept a set SQL Status:0A000 " Can I convert a 'setof text[]' to a 'text[]'? Alternatively I could use a sub-select, but I am curious if there are other= solutions around. Regards, Andreas ___________________________________________________________________________ SCANLAB AG Dr. Andreas Simon Gaab Entwicklung * R & D Siemensstr. 2a * 82178 Puchheim * Germany Tel. +49 (89) 800 746-513 * Fax +49 (89) 800 746-199 mailto:a.gaab@scanlab.de * www.scanlab.de Amtsgericht M=FCnchen: HRB 124707 * USt-IdNr.: DE 129 456 351 Vorstand: Georg Hofner (Sprecher), Christian Huttenloher, Norbert Petschik Aufsichtsrat (Vorsitz): Dr. Hans J. Langer ___________________________________________________________________________ --_000_48DA836F3865C54B8FBF424A3B775AF60132434B4AExchangeServe_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

Hi all,

 <= /p>

I would like to write a query, which aggre= gates the results of regexp_matches(). The problem is that regexp_matches r= eturnes setof text[] as documented even if I discard the global flag (http://www.postgresql.org/docs/8.4/static/functions-ma= tching.html#FUNCTIONS-POSIX-REGEXP ). Thus resulting in an error when I= try to aggregate the result:

 

“

SELECT array_accum(

regexp_matches('foobarbequebaz= ilbarfbonk', '(b[^b]+)(b[^b]+)')

= )

-------------= ------------------

ERROR= :=A0 set-valued function called in context that cannot accept a set

********** Fehler **********

ERROR: set-valued function= called in context that cannot accept a set

SQL Status:0A000

“

 

Can I convert a ‚setof te= xt[]‘ to a ‚text[]‘?

 

A= lternatively I could use a sub-select, but I am curious if there are other = solutions around.

&= nbsp;

Regards,

Andreas

 

______________________________________________= _____________________________

 

SCANLAB AG

<= p class=3DMsoNormal>Dr. Andreas = Simon Gaab

Entwicklung • R & D

 

Siemensstr.&= nbsp;2a • 82178 Puchheim • Germany

Tel. +49 (89)=  800 746-513 • Fax +49 (89) 800 746-199=

mailto:a.gaab@scanlab.de • = www.scanlab.de

<= p class=3DMsoNormal> 

Amtsgericht&nbs= p;M=FCnchen: HRB 124707 • USt-IdNr.: DE 129 456 3= 51

Vorstand: Georg Hofner (Sprecher), Christian Huttenloher,= Norbert Petschik

Aufsichtsrat (Vorsitz): Dr. Hans J.&n= bsp;Langer

________________________________________________________________= ___________

 

=
= --_000_48DA836F3865C54B8FBF424A3B775AF60132434B4AExchangeServe_--