If I try to connect with ActiveRecord to a localhost postgresql database with the following connection parameters :
ActiveRecord::Base.establish_connection(
adapter: 'postgresql',
username: 'test',
host: 'localhost',
password: '123456'
)
I get
FATAL: password authentication failed for user "test" (PG::Error)
And with :
ActiveRecord::Base.establish_connection(
adapter: 'postgresql',
username: 'test',
host: 'localhost'
)
I get
fe_sendauth: no password supplied (PG::ConnectionBad)
My pg_hba.conf lines are :
local all all trust
local all postgres peer
host all all 127.0.0.1/32 md5
host all all ::1/128 md5
Why is ActiveRecord is not using the trust method. I set it for all database and all users (first line).