
This issue occurs when your postgresql server is not running or postgresql cannot connect to the database using the socket.
Follow the below steps to resolve this issue:
- Remove the postmaster.pid.
rm /usr/local/var/<postgresql-version>/postmaster.pid
example: rm /usr/local/var/postgres@15/postmaster.pid
- Restart the postgresql.
brew services restart postgresql