X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/01abcd0825787f96a85953661a62f78d3738586f..27cc5749aa0a60296c6383f3a60d969b17c278a2:/sql/Pg-upgrade2/first_aggregator.sql

diff --git a/sql/Pg-upgrade2/first_aggregator.sql b/sql/Pg-upgrade2/first_aggregator.sql
new file mode 100644
index 000000000..9803988a0
--- /dev/null
+++ b/sql/Pg-upgrade2/first_aggregator.sql
@@ -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
+);
