pgAdmin4.4 没有列出连接

pgAdmin4.4 not listing connections

我在 Linux 上使用 pgAdmin4,但由于某些原因,我无法再列出我存储的连接。它在全新安装上工作了几天,然后在重新启动后突然停止工作(事先没有 installations/updates 完成)。我在具有类似设置的多台机器上遇到过这种情况。

系统信息:

当我尝试列出我存储的连接时,以下内容出现在 ~/.pgadmin/pgadmin4.log 中:

Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/lib/python3.7/site-packages/flask/views.py", line 88, in view
    return self.dispatch_request(*args, **kwargs)
  File "/usr/lib/pgadmin4/web/pgadmin/browser/utils.py", line 259, in dispatch_request
    return method(*args, **kwargs)
  File "/usr/lib/pgadmin4/web/pgadmin/browser/utils.py", line 309, in children
    children.extend(module.get_nodes(*args, **kwargs))
  File "/usr/lib/pgadmin4/web/pgadmin/browser/server_groups/servers/__init__.py", line 127, in get_nodes
    in_recovery, wal_paused = recovery_state(conn, manager.version)
  File "/usr/lib/pgadmin4/web/pgadmin/browser/server_groups/servers/__init__.py", line 52, in recovery_state
    status, result = connection.execute_dict(recovery_check_sql)
  File "/usr/lib/pgadmin4/web/pgadmin/utils/driver/psycopg2/connection.py", line 1202, in execute_dict
    desc.to_dict() for desc in cur.ordered_description()
  File "/usr/lib/pgadmin4/web/pgadmin/utils/driver/psycopg2/connection.py", line 1202, in <listcomp>
    desc.to_dict() for desc in cur.ordered_description()
  File "/usr/lib/pgadmin4/web/pgadmin/utils/driver/psycopg2/cursor.py", line 94, in to_dict
    ores = OrderedDict(self.orig_col._asdict())
AttributeError: 'psycopg2.extensions.Column' object has no attribute '_asdict'

知道这里可能有什么问题吗?

这是新发布的 psycopg2 模块导致的错误,已在最新版本的 pgAdmin4 v4.5 中修复,请将其升级到最新版本。

https://www.pgadmin.org/download/pgadmin-4-python-wheel/

参考:https://redmine.postgresql.org/issues/4143

您可以通过执行以下命令安装 psycopg2 版本 2.7.7 来解决此问题 (因为我在 Python3.6 中安装了 PgAdmin4,所以我的命令如下所示)

sudo python3.6 -m pip install psycopg2==2.7.7

OS: Ubuntu 18.04

Python v: 3.6

psycopg2 当前 v: 2.9