psql: fix query of expire_on_login counter
authorSantiago Gimeno <santiago.gimeno@quantion.es>
Tue, 21 Apr 2015 14:10:12 +0000 (16:10 +0200)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 21 Apr 2015 14:42:48 +0000 (15:42 +0100)
raddb/mods-config/sql/counter/postgresql/expire_on_login.conf

index c4ce096..6ec4c4e 100644 (file)
@@ -1,5 +1,5 @@
 query = "\
-       SELECT TIME_TO_SEC(TIMEDIFF(NOW(), acctstarttime)) \
+       SELECT EXTRACT(EPOCH FROM (NOW() - acctstarttime)) \
        FROM radacct \
        WHERE UserName='%{${key}}' \
        ORDER BY acctstarttime \