I currently have a 9.3 server running (on Ubuntu 14.04) with "trust" set as the authentification method in pg_hba.conf. How can I set the password again. In pgadmin the server currently doesn't allow me to access the console (The PSQL console closes immediately after I open it).

I have the feeling that setting the password using

     $ sudo -u postgres psql

changes the password of a parallel running 9.1 server.


     psql -U postgres

gives an error saying

   psql: FATAL:  Peer-Authentifizierung für Benutzer »postgres« fehlgeschlagen

(peer authentification for user postgres failed)


    # Database administrative login by Unix domain socket
    local   all             postgres                                trust

    # TYPE  DATABASE        USER            ADDRESS                 METHOD

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

Setting password in pgadmin

After setting the password for the postgres user (1), the ENCRYPTED PASSWORD appears in pgadmin (2), but psql -U postgres still fails.

enter image description here

Previous question:

closed as unclear what you're asking by dezso, Colin 't Hart, RLF, Vérace, Shawn Melton Aug 4 '15 at 15:02

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • @a_horse_with_no_name - pinging – tobias47n9e May 9 '14 at 9:45
  • you can't ping a user like that. – ypercubeᵀᴹ Aug 4 '15 at 12:02

If your pg_hba.conf is set correctly and you're sure about your password, and you're still getting issues related to "peer authentication" failed, you probably need to reload your postgresql instance

/etc/init.d/postgresql reload 9.3 

should reload your settings and allow you to use the password. Hope that helps. =)

Not the answer you're looking for? Browse other questions tagged or ask your own question.