尝试使用命令行链接

psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL:  role "root" does not exist

gpt:

sudo -u postgres psql

solved