Restarting the instance worked for me. Also, as mentioned in some other post psql -h '/tmp' worked as well before the restart. But post restart psql directly started working.
So, probably some file ownership issues that got reset with the restart is what I am thinking.