Skip to content

Commit

Permalink
Merge pull request #4182 from esl/fix-pgsql-timestamp
Browse files Browse the repository at this point in the history
Cast the postgres timestamp to integer
  • Loading branch information
arcusfelis authored Dec 4, 2023
2 parents 44b57e6 + 78b60d6 commit 216342f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rdbms/mongoose_rdbms_timestamp.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand Down

0 comments on commit 216342f

Please sign in to comment.