Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+36
@@ -0,0 +1,36 @@
|
||||
-- # $Id$
|
||||
-- # $HeadURL$
|
||||
-- # $Author$
|
||||
|
||||
CREATE OR REPLACE FUNCTION public.reduce_dim1(anyarray)
|
||||
RETURNS SETOF int AS
|
||||
$function$
|
||||
DECLARE
|
||||
s $1%TYPE;
|
||||
BEGIN
|
||||
IF cardinality($1) > 0 THEN
|
||||
FOREACH s SLICE 1 IN ARRAY $1 LOOP
|
||||
RETURN NEXT s[1];
|
||||
END LOOP;
|
||||
END IF;
|
||||
RETURN;
|
||||
END;
|
||||
$function$
|
||||
LANGUAGE plpgsql IMMUTABLE;
|
||||
|
||||
|
||||
CREATE OR REPLACE FUNCTION public.reduce_dim2(anyarray)
|
||||
RETURNS SETOF int AS
|
||||
$function$
|
||||
DECLARE
|
||||
s $1%TYPE;
|
||||
BEGIN
|
||||
IF cardinality($1) > 0 THEN
|
||||
FOREACH s SLICE 1 IN ARRAY $1 LOOP
|
||||
RETURN NEXT s[2];
|
||||
END LOOP;
|
||||
END IF;
|
||||
RETURN;
|
||||
END;
|
||||
$function$
|
||||
LANGUAGE plpgsql IMMUTABLE;
|
||||
Reference in new issue
Block a user