7

Is there a way to get pgadmin to do ident auth for local users? It would be nice to not have to set a password for my local user on a development machine and simply be able to use psql and pgadmin3 without a password.

1 Answer 1

10

Pgadmin just passes through the username you provide to it to the server, if it's asking you for a password, it's because the server is telling it that a password is required for your connection method. If the development machine is a Unix system, then leave the "Host:" field blank so that pgadmin connects using the local Unix socket rather than TCP.

The postgresql server's pg_hba.conf controls how users are identified and when they're required to provide a password. Most default pg_hba.conf files have the following line:

local   all         all                       ident sameuser

This indicates that "local" connections to "all" databases by "all" users use the "ident sameuser" authentication method, meaning that as long as the username you're trying to connect with matches the username you logged in to the machine with, it'll accept the connection without a password. If you want to be able to log in with any username without a password, you can change "ident sameuser" to "trust".

If your system usernames don't match the database usernames, postgresql has a separate file named pg_ident.conf that lists the system username and its matching database username, along with a name for this map. Create entries for your developer(s) and replace "sameuser" in pg_hba.conf with the name of the map.

2
  • 3
    Leaving host blank was all I needed, but thank you =) Oct 30, 2010 at 9:16
  • 1
    Leaving the host blank is no longer valid. It prompts "please specify address" in the status bar and the OK button is disabled until it is non-blank. Nov 27, 2014 at 23:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .