neue Aggregatfunktion "FIRST", für Auswertungen
authorSven Schöling <s.schoeling@linet-services.de>
Tue, 6 Oct 2015 14:04:53 +0000 (16:04 +0200)
committerSven Schöling <s.schoeling@linet-services.de>
Mon, 12 Oct 2015 14:59:26 +0000 (16:59 +0200)
sql/Pg-upgrade2/first_aggregator.sql [new file with mode: 0644]

diff --git a/sql/Pg-upgrade2/first_aggregator.sql b/sql/Pg-upgrade2/first_aggregator.sql
new file mode 100644 (file)
index 0000000..9803988
--- /dev/null
@@ -0,0 +1,15 @@
+-- @tag: first_aggregator
+-- @description: SQL Aggregat Funktion FIRST
+-- @depends: release_3_0_0
+-- @encoding: utf-8
+
+CREATE OR REPLACE FUNCTION public.first_agg ( anyelement, anyelement )
+RETURNS anyelement LANGUAGE SQL IMMUTABLE STRICT AS $$
+  SELECT $1;
+$$;
+
+CREATE AGGREGATE public.FIRST (
+  sfunc    = public.first_agg,
+  basetype = anyelement,
+  stype    = anyelement
+);