From 3daa588be05a5e75812c3bbb179875462fe6878c Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Tue, 27 Oct 2020 15:32:01 +0100 Subject: [PATCH] historian: Remove DATETIME conversion and add timestamp to grouping Postgres requires the HAVING statement to match a GROUP BY statement and the DATETIME function doesn't exist on postgres. --- historian/historian-cli | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/historian/historian-cli b/historian/historian-cli index 554c02e..58bd783 100755 --- a/historian/historian-cli +++ b/historian/historian-cli @@ -117,7 +117,7 @@ WHERE FROM channel_updates u WHERE - u.timestamp >= DATETIME('{}') + u.timestamp >= '{}' GROUP BY u.scid ) @@ -159,9 +159,10 @@ SELECT FROM node_announcements n WHERE - n.timestamp >= DATETIME('{}') + n.timestamp >= '{}' GROUP BY - n.node_id + n.node_id, + n.timestamp HAVING n.timestamp = MAX(n.timestamp) ORDER BY timestamp DESC