When I try to connect and access or start PostgreSQL I get this error!
Sabayon postgresql-9.6 # sudo su -c "createuser --superuser gisuser" postgres
Createuser: could not connect to database postgres: could not connect to server: File or directory not found
The server is running locally and accepting
Connections in the Unix domain socket "/run/postgresql/.s.PGSQL.5432"?
Sabayon postgresql-9.6 # psql --version
Psql (PostgreSQL) 9.6.2
This means your postgres server is not running.
Steps for start a server:
Create a directory where your server will run.
$ mkdir /usr/db/
Assign ownership and permissions to /usr/db/
$ chown postgres:postgres /usr/db/
$ chmod 757 /usr/db/
Run terminal as user postgres
$ su postgres
Run following commands to start server
$ initdb -D /usr/db/
$ pg_ctl start -D /usr/db/
Now, your postgres server should be running. Exit terminal as user postgres, and now you can enter psql terminal using following command
$ psql -U postgres