gpt4 book ai didi

postgresql pg_database_size 在随机时间抛出异常

转载 作者:行者123 更新时间:2023-11-29 13:47:19 25 4
gpt4 key购买 nike

当用户注册到应用程序时,我们使用 Azure 数据库 PostgreSQL(服务)为每个用户创建数据库(目前用户数据库少于 25 个)。

出于报告目的,我们需要每个用户的数据库大小的信息。为了检索数据库大小,我们有一个 Postgres 函数,它会触发以下查询

SELECT pg_database.datname , pg_database_size(pg_database.datname) FROM 
pg_database

我们每小时执行这个函数,抛出 azure 函数,但随机时间 Postgres 抛出异常

Exception: Npgsql.PostgresException (0x80004005): 58P01: could not read directory "base/16452": No such file or directory at...

大多数情况下,不同目录或文件位置的异常保持相同

有时它也会抛出异常

Exception: Npgsql.NpgsqlException (0x80004005): Exception while reading from stream ---> System.IO.IOException: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ---> System.Net.Sockets.SocketException

最佳答案

在 MSDN 论坛上研究解决方案 here .

关于postgresql pg_database_size 在随机时间抛出异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46236622/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com