标签: postgres-10

错误:函数round(双精度,整数)不存在

我正在迁移一些查询,这些查询已经使用 MySQL 数据库运行了很长时间,现在在 Postgres 中具有相同的结构。我被简单的圆形函数卡住了,它以以下错误消息结尾。

错误:函数round(双精度,整数)不存在

select 的一部分不起作用:

round(floor(pools.available_capacity_in_kb/1024/1024/1024*100)/100,2) as free,
Run Code Online (Sandbox Code Playgroud)

pools.available_capacity_in_kb 在数据库中存储为 BIGINT (Postgres 10.9)

sql postgresql rounding postgres-10

9
推荐指数
3
解决办法
2万
查看次数

Heroku Postgres:“psql:致命:没有主机的 pg_hba.conf 条目”

有许多 Heroku CLI Postgres 命令都返回相同的错误。例如:

$ heroku pg:bloat
psql: FATAL:  no pg_hba.conf entry for host "...", user "...", database "...", SSL off
Run Code Online (Sandbox Code Playgroud)

这些命令中至少有一个在过去有效,但现在无效。

否则数据库似乎工作正常。我可以通过我的应用程序的接口访问它。

我没有看到在 Heroku Postgres 仪表板中切换 SSL 的方法。什么可能导致这种情况,我该如何解决?

postgresql heroku heroku-postgres heroku-cli postgres-10

6
推荐指数
5
解决办法
9972
查看次数