1
0
mirror of https://github.com/agdsn/ancient-weatherstation.git synced 2026-06-19 23:07:59 +00:00

Database Opt

git-svn-id: file:///home/jan/tmp/wetterstation/trunk@245 dd492736-c11a-0410-ad51-8c26713eaf7f
This commit is contained in:
jan
2008-03-20 17:48:54 +00:00
parent 8fed47f7a0
commit 2fc294e8cb
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -326,7 +326,7 @@ pix_list_ptr get_pix_list(int c_width){
}
/* Anfrage zusammenbauen */
snprintf(query, BUFFSIZE, "SELECT round(date_part('epoch', current_timestamp))::int4 AS now, round(date_part('epoch', timestamp))::int4 AS times, %s AS val FROM %s WHERE sens_id=%d AND timestamp > (current_timestamp - INTERVAL '%d seconds') ORDER BY times ASC", img_cfg.table_field, table, img_cfg.sens_id, img_cfg.show_interval );
snprintf(query, BUFFSIZE, "SELECT round(date_part('epoch', current_timestamp))::int4 AS now, round(date_part('epoch', timestamp))::int4 AS times, %s AS val FROM %s WHERE sens_id=%d AND timestamp > (select (current_timestamp - INTERVAL '%d seconds')) ORDER BY times ASC", img_cfg.table_field, table, img_cfg.sens_id, img_cfg.show_interval );
/* Anfrage stellen */
res = pg_check_exec(conn, query, 1);