]> git.proxmox.com Git - pmg-api.git/commit - src/bin/pmgpolicy
postgresql compat: cast result from EXTRACT to INTEGER
authorStoiko Ivanov <s.ivanov@proxmox.com>
Mon, 26 Jun 2023 20:45:10 +0000 (22:45 +0200)
committerDominik Csapak <d.csapak@proxmox.com>
Tue, 27 Jun 2023 08:16:03 +0000 (10:16 +0200)
commit9972a7ce1690fcb0c39ae64dfe55e11b7aace8b0
tree94b91b3697354f0a69c3b612c79cece76d04cb56
parenta51a537f89c031489310455af80bd835c058b7ee
postgresql compat: cast result from EXTRACT to INTEGER

Postgresql has changed the return type of the EXTRACT function to
numeric from float8 [0] in version 14, and I strongly assume that this
change is the reason why:
`SELECT EXTRACT (EPOCH FROM now());`
now returns a floating point instead of an integer value, which in
turn is not accepted in the prepared statements throughout our
codebase.

[0] https://www.postgresql.org/docs/release/14.0/

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/PMG/DBTools.pm
src/PMG/Quarantine.pm
src/PMG/Statistic.pm
src/bin/pmgpolicy