系统是 ubuntu20.04 ,按照官网,通过添加软件源,然后安装 postgres,然后默认有个 postgres 用户,然后我先sudo su - postgres切换到这个用户,然后psql直接进入,然后修改密码,之后退出,切换回我自己的另一个 linux 用户test,然后在这个 test 用户这里,使用psql -U postgres无法进入,显示psql: error: FATAL: Peer authentication failed for user "postgres",比如指定psql -U postgres -h localhost才可以,或者设置环境变量PGHOST,这是为什么呢?
没搜到相关的东西啊,看很多教程也没有提到这个