Changes between Initial Version and Version 1 of drmsCheckTriggers


Ignore:
Timestamp:
02/10/14 13:17:48 (11 years ago)
Author:
niles
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • drmsCheckTriggers

    v1 v1  
     1= Checking Triggers = 
     2 
     3If a site is subscribed to a data series, then it will be notified when there are new storage unit numbers for that series. It is then up 
     4to the site to do something about it, that is, to put the storage unit numbers on the queue to get them processed. 
     5 
     6To illustrate : 
     7 
     8The following SUMS database queries will list all the series tables fof aia and hmi : 
     9 
     10{{{ 
     11\d aia.* 
     12\d hmi.* 
     13}}} 
     14 
     15Note that one of the hmi series is called "hmi.v_avg120", so we can describe that : 
     16 
     17{{{ 
     18\d hmi.v_avg120 
     19}}} 
     20 
     21 
     22Which, among other things, shows : 
     23 
     24{{{ 
     25Triggers: 
     26    hmi_v_avg120_trg AFTER INSERT ON hmi.v_avg120 FOR EACH ROW EXECUTE PROCEDURE hmi_v_avg120_fc() 
     27}}} 
     28 
     29So the trigger hmi_v_avg120_trg will run the procedure hmi_v_avg120_fc() every time a row is inserted in hmi.v_avg120. To see the procedure : 
     30 
     31{{{ 
     32\df+ hmi_v_avg120_fc() 
     33}}} 
     34 
     35 
     36Which shows the source for the procedure - it adds the sunum to the queue : 
     37 
     38{{{ 
     39BEGIN 
     40 IF (TG_OP='INSERT' AND new.sunum > 0) THEN 
     41  INSERT INTO sunum_queue (sunum,recnum,series_name) VALUES (new.sunum,new.recnum,'hmi.V_avg120'); 
     42 END IF; 
     43 RETURN NEW; 
     44END 
     45}}} 
     46 
     47Note that this still does not get the data on disk - but your local DRMS/SUMS database now has knowledge that the data exists offsite. Given that, the JMD 
     48will be able to download it. 
     49