Changeset 5de3ee066898c7932e978dbe8224ca4e280635cb

Show
Ignore:
Timestamp:
05/14/08 00:54:13 (6 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1210726453 +0000
git-parent:

[143a7f5401614fa0dcc032e7a584d559ac74def5]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1210726453 +0000
Message:

fix the triggers.. the row itself is called nam, the summary is metric_name. Also, move the if not found's in the windowed functions to be immediately after window selection

Files:

Legend:

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

    r143a7f5 r5de3ee0  
    266266    END IF; 
    267267     
    268     SELECT sid,metric_name FROM stratcon.metric_name_summary WHERE sid=NEW.sid  and metric_name=NEW.metric_name 
     268    SELECT sid,metric_name FROM stratcon.metric_name_summary WHERE sid=NEW.sid  and metric_name=NEW.name 
    269269         INTO v_sid,v_name; 
    270270       IF NOT FOUND THEN 
    271            INSERT INTO  stratcon.metric_name_summary(sid,metric_name,metric_type)  VALUES(NEW.sid,NEW.metric_name,'text'); 
     271           INSERT INTO  stratcon.metric_name_summary(sid,metric_name,metric_type)  VALUES(NEW.sid,NEW.name,'text'); 
    272272    END IF; 
    273273 
     
    299299    END IF; 
    300300 
    301    SELECT sid,metric_name FROM stratcon.metric_name_summary WHERE sid=NEW.sid  and metric_name=NEW.metric_name 
     301   SELECT sid,metric_name FROM stratcon.metric_name_summary WHERE sid=NEW.sid  and metric_name=NEW.name 
    302302     INTO v_sid,v_name; 
    303303   IF NOT FOUND THEN 
    304        INSERT INTO  stratcon.metric_name_summary VALUES(NEW.sid,NEW.metric_name,'numeric'); 
     304       INSERT INTO  stratcon.metric_name_summary VALUES(NEW.sid,NEW.name,'numeric'); 
    305305    END IF; 
    306306 
     
    961961  select * into v_target from stratcon.choose_window(in_start_time, in_end_time, in_hopeful_nperiods); 
    962962 
     963  if not found then 
     964    raise exception 'no target table'; 
     965    return; 
     966  end if; 
     967 
    963968  select 'epoch'::timestamp + 
    964969         ((floor(extract('epoch' from in_start_time) / 
     
    972977           extract('epoch' from v_target.period)) || ' seconds') ::interval 
    973978    into v_end_adj; 
    974  
    975   if not found then 
    976     raise exception 'no target table'; 
    977     return; 
    978   end if; 
    979979 
    980980  v_sql := 'select ' || v_sid || ' as sid, ' || quote_literal(in_name) || ' as name, ' ||