Agregation Function

From: Pierre-Yves LANDURE <pylandur(at)ifremer(dot)fr>
To: pgsql-novice(at)postgresql(dot)org
Subject: Agregation Function
Date: 2002-07-02 07:40:11
Message-ID: 1025595612.15239.2.camel@Polux
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi, i have to create an agregation function.. what is the syntax.

The function to be agregation is :

DROP FUNCTION "polygon_agregation"(polygon);
CREATE FUNCTION "polygon_agregation"(polygon) RETURNS box AS 'DECLARE
polygons_to_agregate ALIAS FOR $1
BEGIN
agregated_polygons = NULL;

FOR poly IN polygons_to_agregate LOOP
IF agregated_polygons = NULL THEN agregated_polygons = box(poly);
agregated_polygons = box(agregated_polygons, box(poly));
END LOOP;

RETURN agregated_polygons,
END' LANGUAGE 'plpgsql'

Thanx

Pierre-Yves Landuré

Browse pgsql-novice by date

  From Date Subject
Next Message Steven D. Smith 2002-07-02 11:40:37 Error Trapping -duplicate keys
Previous Message S.A.Pamungkas 2002-07-02 07:37:51 modify table