From 78b60d6b1fb05e0e9104fc3a083b2efab23b5ee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chrz=C4=85szcz?= Date: Mon, 4 Dec 2023 11:20:10 +0100 Subject: [PATCH] Cast the postgres timestamp to integer ROUND returns a float on Postgres 13.9, resulting in a type error. --- src/rdbms/mongoose_rdbms_timestamp.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rdbms/mongoose_rdbms_timestamp.erl b/src/rdbms/mongoose_rdbms_timestamp.erl index 7cab9f07fbf..9b57434b292 100644 --- a/src/rdbms/mongoose_rdbms_timestamp.erl +++ b/src/rdbms/mongoose_rdbms_timestamp.erl @@ -12,7 +12,7 @@ select_query() -> {mysql, _} -> <<"SELECT UNIX_TIMESTAMP()">>; {pgsql, _} -> - <<"SELECT ROUND(extract(epoch from now()))">>; + <<"SELECT CAST(extract(epoch from now()) AS integer)">>; {odbc, mssql} -> <<"SELECT DATEDIFF_BIG(second, '1970-01-01 00:00:00', GETUTCDATE())">>; Other ->