postgres用户有什么区别?

时间:2014-07-01 11:34:43

标签: postgresql jboss postgresql-9.2

我是postgres的新手并且有一些问题。 我在我的linux系统上安装了postgresql,它在系统上创建了一个用户postgres,我在pgadmin中有postgres用户,他们是同一个用户吗?

我遇到jboss问题,连接数据源导致身份验证问题和密码。

的pg_hba.conf:

> # TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only local   all             all                                     trust
# IPv4 local connections: host    all             all             127.0.0.1/32            md5
# IPv6 local connections: host    all             all             ::1/128                 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                trust
#host    replication     postgres        127.0.0.1/32            trust
#host    replication     postgres        ::1/128                 trust

异常:

  

引起:org.postgresql.util.PSQLException:致命:密码   用户认证失败" postgres"在   org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:398)     在   org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:173)     在   org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:64)     在   org.postgresql.jdbc2.AbstractJdbc2Connection。(AbstractJdbc2Connection.java:136)     在   org.postgresql.jdbc3.AbstractJdbc3Connection。(AbstractJdbc3Connection.java:29)     在   org.postgresql.jdbc3g.AbstractJdbc3gConnection。(AbstractJdbc3gConnection.java:21)     在   org.postgresql.jdbc4.AbstractJdbc4Connection。(AbstractJdbc4Connection.java:31)     在   org.postgresql.jdbc4.Jdbc4Connection。(Jdbc4Connection.java:24)     在org.postgresql.Driver.makeConnection(Driver.java:393)at   org.postgresql.Driver.connect(Driver.java:267)

1 个答案:

答案 0 :(得分:0)

您的pg_hba.conf文件会显示已注释掉的每一行。实际情况是这样,PostgreSQL甚至会拒绝开始。

postgres OS用户和postgres数据库角色几乎完全独立。

如果您在peer中使用identpg_hba.conf形式的身份验证,则需要成为postgres系统用户才能登录作为postgres数据库角色。但是你没有使用这些表格。此外,如果您未指定要连接的角色(例如,使用-U),则许多程序将默认使用OS用户的名称作为尝试连接的角色的名称。

除此之外,他们没有关系。特别是他们不会自动共享相同的密码。