Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id F20256331B3 for ; Tue, 3 Aug 2010 11:48:39 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 59517-06 for ; Tue, 3 Aug 2010 14:48:27 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id B3E9C632C19 for ; Tue, 3 Aug 2010 11:48:28 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o73EmQVO019610; Tue, 3 Aug 2010 10:48:26 -0400 (EDT) To: =?UTF-8?Q?Viktor_Bojovi=C4=87?= cc: pgsql-sql@postgresql.org Subject: Re: aggregate function In-reply-to: References: Comments: In-reply-to =?UTF-8?Q?Viktor_Bojovi=C4=87?= message dated "Tue, 03 Aug 2010 16:38:51 +0200" Date: Tue, 03 Aug 2010 10:48:25 -0400 Message-ID: <19609.1280846905@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201008/2 X-Sequence-Number: 34442 =?UTF-8?Q?Viktor_Bojovi=C4=87?= writes: > I tried to write this part below, but something is wrong (ERROR: function > grafika.pov_sphere(character varying, numeric, numeric, numeric, numeric, > character varying) does not exist) so I wanted to ask if someone knows how > to solve this problem. Well, it's right: you didn't create such a function. The aggregate transition function has to take the state datatype as its first argument. You can't just plug these two randomly-chosen functions into an aggregate definition and expect the system to intuit what you want done. I think what you actually need is a transition function that works something like if ($1 is null) return agg_pov_sphere($2,$3,...); else return concat($1, agg_pov_sphere($2,$3,...)); regards, tom lane