First I want to start by saying the most relevant answer was here. When I try to run the following here's what I get:
$ sudo -u postgres psql
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 can also confirm that the server starts up and quits by running the first command below. The second command below confirms that the server started but immediately exited,
$ sudo service postgresql restart
$ sudo service postgresql status
● postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
Active: active (exited) since Mon 2017-09-25 18:37:32 EDT; 11min ago
Process: 8459 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 8459 (code=exited, status=0/SUCCESS)
Sep 25 18:37:32 atas-250-557 systemd[1]: Starting PostgreSQL RDBMS...
Sep 25 18:37:32 atas-250-557 systemd[1]: Started PostgreSQL RDBMS.
An answer that seems promising:
postgresql.org telling me to start my server in
/usr/local/pgsql/data
but I DON'T EVEN HAVE the dir/usr/local/pgsql
. This leads me to believe that in my installations and deletions something was not reinstalled.I have installed
sudo apt-get install postgresql
sudo apt-get install postgresql-client-common
sudo apt-get install postgresql-client
- PostgreSQL-9.6.5 for Ubuntu 16.04 via the installer (but this may be redundant).
Lastly, the uninstaller found in /opt/PostgreSQL/9.6
doesn't even remove everything from my system the way it should. I'm left with a the window of the leftover files after uninstalling. If you could help me fix the could not connect to server
issue at the top that would be preferred. Last resort I would be willing to wipe everything clean, but haven't had any luck so far.