| | 1 | = Checking Triggers = |
| | 2 | |
| | 3 | If 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 |
| | 4 | to the site to do something about it, that is, to put the storage unit numbers on the queue to get them processed. |
| | 5 | |
| | 6 | To illustrate : |
| | 7 | |
| | 8 | The following SUMS database queries will list all the series tables fof aia and hmi : |
| | 9 | |
| | 10 | {{{ |
| | 11 | \d aia.* |
| | 12 | \d hmi.* |
| | 13 | }}} |
| | 14 | |
| | 15 | Note 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 | |
| | 22 | Which, among other things, shows : |
| | 23 | |
| | 24 | {{{ |
| | 25 | Triggers: |
| | 26 | hmi_v_avg120_trg AFTER INSERT ON hmi.v_avg120 FOR EACH ROW EXECUTE PROCEDURE hmi_v_avg120_fc() |
| | 27 | }}} |
| | 28 | |
| | 29 | So 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 | |
| | 36 | Which shows the source for the procedure - it adds the sunum to the queue : |
| | 37 | |
| | 38 | {{{ |
| | 39 | BEGIN |
| | 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; |
| | 44 | END |
| | 45 | }}} |
| | 46 | |
| | 47 | Note 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 |
| | 48 | will be able to download it. |
| | 49 | |