Show
Ignore:
Timestamp:
10/13/08 18:13:40 (6 years ago)
Author:
Denish Patel <denish@omniti.com>
git-committer:
Denish Patel <denish@omniti.com> 1223921620 +0000
git-parent:

[f2fcde0512e2ff2b14a8f019757192561c15bc81]

git-author:
Denish Patel <denish@omniti.com> 1223921620 +0000
Message:

Fixed sved graphs trigger

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sql/reconnoiter_ddl_dump.sql

    r848c999 r04c2ba0  
    710710 
    711711CREATE FUNCTION trig_update_tsvector_saved_graphs() RETURNS trigger 
    712     AS $$DECLARE 
     712    AS $$ 
     713DECLARE 
    713714 BEGIN 
    714715 IF TG_OP != 'INSERT' THEN 
     
    717718   END IF;     
    718719 ELSE  
    719     UPDATE prism.saved_graphs SET ts_search_all=prism.saved_graphs_tsvector(NEW.graphid) where graphid=NEW.graphid
     720    UPDATE prism.saved_graphs SET ts_search_all=prism.saved_graphs_tsvector(NEW.graphid) where graphid=(NEW.graphid)
    720721 END IF;   
    721722   RETURN NEW; 
     
    866867 
    867868CREATE FUNCTION fetch_dataset(in_uuid uuid, in_name text, in_start_time timestamp with time zone, in_end_time timestamp with time zone, in_hopeful_nperiods integer, derive boolean) RETURNS SETOF rollup_matrix_numeric_5m 
    868     AS $$ 
    869 declare 
     869    AS $$declare 
    870870  v_sid int; 
    871871  v_record stratcon.rollup_matrix_numeric_5m%rowtype; 
     
    876876  end if; 
    877877 
    878     for v_record in  select sid, name, rollup_time, count_rows, avg_value from stratcon.fetch_dataset(v_sid::integer, in_name, in_start_time, in_end_time, in_hopeful_nperiods, derive) loop 
     878    for v_record in  select sid, name, rollup_time, count_rows, avg_value, counter_dev from stratcon.fetch_dataset(v_sid::integer, in_name, in_start_time, in_end_time, in_hopeful_nperiods, derive) loop 
    879879    return next v_record;  
    880880    end loop; 
     
    894894 
    895895CREATE FUNCTION fetch_dataset(in_sid integer, in_name text, in_start_time timestamp with time zone, in_end_time timestamp with time zone, in_hopeful_nperiods integer, derive boolean) RETURNS SETOF rollup_matrix_numeric_5m 
    896     AS $$ 
    897 declare 
     896    AS $$declare 
    898897  v_sql text; 
    899898  v_sid int; 
     
    930929 
    931930  v_sql := 'select ' || v_sid || ' as sid, ' || quote_literal(in_name) || ' as name, ' || 
    932            's.rollup_time, d.count_rows, d.avg_value ' || 
     931           's.rollup_time, d.count_rows, d.avg_value, d.counter_dev ' || 
    933932           ' from ' || 
    934933           '(select ' || quote_literal(v_start_adj) || '::timestamp' || 
     
    10801079    -- No rows. 
    10811080    for v_change_row in 
    1082       select v_sid as sid, v_start_adj as whence, in_name as name, value 
    1083         from stratcon.loading_dock_metric_text_s_change_log 
    1084        where sid = v_sid and name = in_name and whence <= v_start_adj 
    1085     order by whence desc 
    1086        limit 1 
     1081      select v_sid as sid, v_start_adj as whence, in_name as name, v_start_text as value 
    10871082    loop 
    10881083      return next v_change_row;