From 30d0e5d298b900eebf8e68f76751829875939039 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Thu, 10 Sep 2015 15:55:25 +0200 Subject: [PATCH] Select must be specific about what fields it wants --- cmd/ursrv/main.go | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/cmd/ursrv/main.go b/cmd/ursrv/main.go index de971ff68..d7a2292dd 100644 --- a/cmd/ursrv/main.go +++ b/cmd/ursrv/main.go @@ -414,7 +414,25 @@ func getReport(db *sql.DB) map[string]interface{} { var compilers []string var builders []string - rows, err := db.Query(`SELECT * FROM Reports WHERE Received > now() - '1 day'::INTERVAL`) + fields := []string{ + "Received", + "UniqueID", + "Version", + "LongVersion", + "Platform", + "NumFolders", + "NumDevices", + "TotFiles", + "FolderMaxFiles", + "TotMiB", + "FolderMaxMiB", + "MemoryUsageMiB", + "SHA256Perf", + "MemorySize", + "Date", + } + + rows, err := db.Query(`SELECT ` + strings.Join(fields, ",") + ` FROM Reports WHERE Received > now() - '1 day'::INTERVAL`) if err != nil { log.Println("sql:", err) return nil