Agregation Function - Mailing list pgsql-novice

From Pierre-Yves LANDURE
Subject Agregation Function
Date
Msg-id 1025595612.15239.2.camel@Polux
Whole thread Raw
List 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é




pgsql-novice by date:

Previous
From: "S.A.Pamungkas"
Date:
Subject: modify table
Next
From: "Steven D. Smith"
Date:
Subject: Error Trapping -duplicate keys