Search Postgresql Archives

checking for NULLS in aggregate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I've defined a function to calculate standard deviation of angular
values:

CREATE AGGREGATE public.stddev(angle_vectors) (
  SFUNC=array_append,
  STYPE=angle_vectors[],
  FINALFUNC=angle_vectors_stddev_yamartino
);

The type angle_vectors is simply an array:

CREATE TYPE public.angle_vectors AS
   (x double precision,
    y double precision);
COMMENT ON TYPE public.angle_vectors
  IS 'This type holds the x (sine) and y (cosine) components of angle(s).';

How can I protect this function so that NULL is returned whenever *all*
input rows are NULL?

Thanks for any feedback,

-- 
Seb



-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux