Ch 7 - Error for `createuser postgres`

In page 135 of the PDF, we are prompted to enter a series of commands to set up PostgreSQL:

brew install postgresql
brew services start postgresql

While the above part worked fine, the following led to an error:

createuser postgres

The error states this:

createuser: could not connect to database postgres: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

I did some research on this error message which brought me to this stackoverflow post, but the top suggestion to delete /usr/local/var/postgres/ did not help in resolving my problem.

Has anyone encountered this before?

@dokun1 Can you please help with this when you get a chance? Thank you - much appreciated! :]

@kelvin_lau I will DM you on slack to resolve this :slight_smile: