User Tools

Site Tools


doc:grb_scripts

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doc:grb_scripts [2012/03/23 06:04] – added "Updating by using psql" jtellodoc:grb_scripts [Unknown date] (current) – external edit (Unknown date) 127.0.0.1
Line 53: Line 53:
 ===== Updating by using psql ===== ===== Updating by using psql =====
 //The following is added by someone learning the system and is not official:// //The following is added by someone learning the system and is not official://
 +
 Since the grb_script table in the stars database is properly set to have the constrain of being UNIQUE, if the method described above is attempted for updating the script psql will refuse to add it again and will output among other things: Since the grb_script table in the stars database is properly set to have the constrain of being UNIQUE, if the method described above is attempted for updating the script psql will refuse to add it again and will output among other things:
 <code bash> <code bash>
Line 61: Line 62:
 user@host:~$ psql stars user@host:~$ psql stars
 stars=> UPDATE grb_script SET grb_script_script = 'filter=0 E 30' WHERE grb_script_end = '600' and camera_name="C5"; stars=> UPDATE grb_script SET grb_script_script = 'filter=0 E 30' WHERE grb_script_end = '600' and camera_name="C5";
-stars=> INSERT INTO grb_script VALUES ('C0', '600', 'filter=0 EMON=off filter=C E 30');+stars=> INSERT INTO grb_script VALUES ('C5', '300', 'filter=0 EMON=off filter=C E 30')
 +stars=> UPDATE grb_script SET grb_script_script = 'filter=0 E 180' WHERE grb_script_end IS NULL and camera_name="C5";
 </code> </code>
 +
 +Note that:
 +  - The first command will update what camera C5 will do until 10 minutes
 +  - The second command will insert the previously undefined behaviour for C5 that will happen until 300 seconds
 +  - And the third will update that which will be done after all other defined behaviours. Note that for this case the column is not search by a literal expression like '\N' but by the condition "IS NULL"
doc/grb_scripts.1332479079.txt.gz · Last modified: 2012/03/23 00:00 (external edit)