Changes between Version 34 and Version 35 of statusdatabase


Ignore:
Timestamp:
Oct 16, 2014, 11:59:59 AM (9 years ago)
Author:
tec
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • statusdatabase

    v34 v35  
    4747AS ct(id int, c1 text, c2 text, c3 text, c4 text, c5 text, c6 text, c7 text, c8 text, c9 text);
    4848}}}
     49
     50The `update_view` function runs whenever the sensor table is updated. This is the nasty hack, basically crosstab cannot create pivot tables with a dynamic number of columns, this function gets around that. It builds up an sql statement that creates a view of a crosstab, but at the end where you define crosstab columns it runs a query on the sensor table and adds the sensors as the columns then runs the query. Quotes in this are escaped 2 times so `'` = `''''`