You might end up having this issue if you have a postgreSQL Enterprise version installed on your mac. PotsgreSQL installed from brew won't work until you have removed the enterprise version.
How to check?
ls /Library
If you have a PostgreSQL folder in there, you have an enterprise version installed, if not this solution is not for you.
How to uninstall PostgreSQL Enterprise
:
Run the uninstall file present in /Library/Postgresql/13(or the version you have installed)
If the file is not present you can reinstall the enterprise version from here. Running the installer will re-generate the uninstaller file in the folder.
Uninstall all postgresql installed with brew:
brew uninstall postgresql@13 (adapt to your version)
Run:
brew update
Run:
brew doctor
Run:
brew install postgresql
Run:
brew install postgresql
Voila