I have screwed up my access to local postgresql installation by altering postgres user password to null and now i am unable to access postgresql at all. I have already fixed up my pa_hba.conf to trust as follows:
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all all trust
# IPv4 local connections:
host all all 0.0.0.0/32 trust
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all trust
host replication all 127.0.0.1/32 trust
host replication all ::1/128 trust
I have restarted postgres with brew services restart postgres and that didn't work... so I just rebooted my Mac... that also didn't work.
my authentication attempts look like this:
psql -U postgres
Password for user postgres:
psql: FATAL: password authentication failed for user "postgres"
psql -U postgres
Password for user postgres:
psql: fe_sendauth: no password supplied
I did notice that the following:
which postgres
/usr/local/bin/postgres
/usr/local/bin/postgres does not exist and the config that I'm modifying is located at /usr/local/var/postgres/pg_hba.conf
Prerequisite information:
postgres --version
postgres (PostgreSQL) 11.1
OS: MacOS