root/sql/sprocs/stratcon.init_metric_numeric_rollup.sql

Revision ca2e7b333cef7d61df1c419439970dd240a691f1, 0.7 kB (checked in by Robert Treat <robert@omniti.com>, 9 years ago)

says you

  • Property mode set to 100644
Line 
1 CREATE TYPE stratcon.metric_numeric_rollup AS (sid integer,  name text, rollup_time timestamp with time zone, count_rows integer[], avg_value numeric[], counter_dev numeric[]); 
2
3 CREATE OR REPLACE FUNCTION stratcon.init_metric_numeric_rollup(in_rollup text)
4 RETURNS SETOF stratcon.metric_numeric_rollup
5 AS $$
6   SELECT null::int, null::text, null::timestamptz, array_agg(count_rows), array_agg(avg_value), array_agg(counter_dev) from (select NULL::int as count_rows, NULL::numeric as avg_value, NULL::numeric as counter_dev from generate_series(1,(select span/seconds from metric_numeric_rollup_config where rollup = $1))) x;
7 $$
8 LANGUAGE 'sql'
9 SECURITY DEFINER
10 ;
11
12
Note: See TracBrowser for help on using the browser.