1

I added a new user to posgresql (amanda) which is the same as my linux system user. At the console, I can open psql just fine -- I don't need a password because I'm already authenticated as amanda. But when I try to set up pgAdmin III without a password, I get an error:

An error has occurred:

01:18:47 PM: Error: Error connecting to the server: fe_sendauth: no password supplied

And if I provide my system password, I get a password error:

An error has occurred:

01:15:30 PM: Error: Error connecting to the server: FATAL:  password authentication failed for user "amanda"
FATAL:  password authentication failed for user "amanda"

How do I get pgAdmin3 talking to postgres as amanda?

This is all @ localhost. I read this:

PgAdmin III - How to connect to database when password is empty?

but the answer there discusses trust authentication. My read of the auth methods section of the manual suggests that what I want is for pgAdmin3 to use Ident Auth.

2
  • 1
    Does this help? Feb 21, 2018 at 22:28
  • Sort of? They point to a piece of the manual that was a good start. I think what I'm trying to do is "ident authentication" -- not "trust authentication" though. I got it sorted by defining a password for "amanda" in psql. But I'm updating the actual question to reflect what I learned there.
    – Amanda
    Feb 21, 2018 at 23:42

1 Answer 1

1

On Unix, when psql is used without the -h option or a PGHOST variable set, it uses Unix local domain sockets, which corresponds to local in the TYPE column in pg_hba.conf and no ADDR column at all.

That differs from putting localhost in the host field of pgAdmin's connection dialog. This one corresponds to host in the TYPE column and 127.0.0.1 in the ADDR column or whatever localhost is resolved to by the TCP stack (with IPv6 it could be ::1 for instance).

In general, this is what is confusing when psql and pgAdmin connection attempts do not trigger the same rules in pg_hba.conf. If that's the case in this question, try to leave the host field in pgAdmin empty.

On top of that, Windows does not have Unix local domain sockets so psql on Windows defaults on localhost as if -h localhost was used.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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