Postgresql socket connection not recognized

Hi brocaar, Thanks for recommending me this portal in GITHUB.I am trying to run “sudo -u postgres psql” i get th efollowing error:

psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket “/var/run/postgresql/.s.PGSQL.5432”?
I am kinda struggling for quite a few hours now.Please respond asap.

Did you check if PostgreSQL is running?

status of postgresql shows:

Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
Active: active (exited) since Wed 2017-08-02 18:42:41 IST; 6min ago
Process: 720 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 720 (code=exited, status=0/SUCCESS)

Aug 02 18:42:41 user-X550LC systemd[1]: Starting PostgreSQL RDBMS…
Aug 02 18:42:41 user-X550LC systemd[1]: Started PostgreSQL RDBMS.

just purged postgresql and installed again, it still shows the same error

ps axf | grep postgres:

2354 pts/4 S+ 0:00 _ grep --color=auto postgres

And this was the only reason i was posting in github…cheers bro…I’ll figure it out