I did a silly mistake. I wanted to set postgres permissions to a folder for exporting data from my database. So I set something like sudo chmod 777 -u postgres /home/user
and then my home partition only has root permissions and nothing worked without root permissions. I solved this problem by using sudo chown user /home/user
and then I set the permissions manually in the file manager on linux. It was very stupid, I didn't knew very much about allocating permissions to directories and users.
The Problem is now, that I can't connect to my database anymore.
~ $ sudo -u postgres psql
[sudo] password for user:
could not change directory to "/home/user"
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 think I want to connect in a folder where the postgres user can't read.
Restarting the server with sudo service postgresql restart
doesn't work as well.
I am a bit nervous and helpless, because of my database and that I can't connect it in some way.
I'm using PostgreSQL 9.1.