X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 32CF39FB28D for ; Fri, 15 Sep 2006 11:41:19 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 09746-05 for ; Fri, 15 Sep 2006 14:41:10 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) by postgresql.org (Postfix) with ESMTP id 0FDD39FA2C7 for ; Fri, 15 Sep 2006 11:41:09 -0300 (ADT) Received: from kingfisher.intern.logix-tt.com (84-72-188-217.dclient.hispeed.ch [84.72.188.217]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logix-tt.com (Postfix) with ESMTP id EF34E6597B for ; Fri, 15 Sep 2006 16:43:22 +0200 (CEST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id 0AC08181C1C09 for ; Fri, 15 Sep 2006 16:41:10 +0200 (CEST) Message-ID: <450ABB85.9060508@logix-tt.com> Date: Fri, 15 Sep 2006 16:41:09 +0200 From: Markus Schaber Organization: Logical Tracking and Tracing International AG, Switzerland User-Agent: Thunderbird 1.5.0.5 (X11/20060812) MIME-Version: 1.0 To: PostgreSQL SQL List Subject: Re: Aggregates with internal state type? References: <45086B40.3000200@logix-tt.com> <16722.1158181987@sss.pgh.pa.us> <450875FC.9040907@logix-tt.com> In-Reply-To: <450875FC.9040907@logix-tt.com> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200609/111 X-Sequence-Number: 26322 Hi, Tom, Markus Schaber wrote: >>> This lead me to the question whether it is possible to use "internal" as >>> state type for an Aggregate whose functions are implemented in C. >> No, because the system has no idea what the representation of an >> "internal" state value might be, and in particular how to copy it. >> The same goes for other pseudotypes. > Ah, I see. So there's no possibility to pass some void* kind of > intermediate data, I have to craft at least a dummy PostgreSQL datatype > for it. > This also solves the question how such things would be cleaned up in > case of an intermediate error. As we are at it: How would you estimate the chances for a Patch to get included that lets C functions pass some void* data pointer around in an aggregate, when the aggregate provides a custom "clean-up" function that gets called whenever the scan gets aborted prematurely? I assume that this could help speeding up e. G. Array Aggregates, or PostGIS geomUnion() or string concatenations etc. Thanks, Markus -- Markus Schaber | Logical Tracking&Tracing International AG Dipl. Inf. | Software Development GIS Fight against software patents in Europe! www.ffii.org www.nosoftwarepatents.org