致命:数据库“postgres”当前不接受连接

FATAL: database “postgres” is not currently accepting connections

我在 linux ubuntu,看来我在 运行 update pg_database set datallowconn = false; 之后屏蔽了自己所以现在所有数据库包括 postgres、template0 和 template1 都没有接受连接,当我尝试连接时它一直说

FATAL: database "postgres" is not currently accepting connections

我正在使用 postgresql 版本 11

哇,真是泡菜。

您必须启动服务器 in single-user mode,这会绕过检查,然后再次更新 pg_database。