This will also allow connection from a remote ip which is why it is disabled by default. Thanks for contributing on this one! Worked on other projects so I did not work on psql for a while But when installation was done, it used to work correctly, I made a test database, initialized postgres user, etc. However, trouble struck once I tried to run any specs that needed to connect to Postgres. You might want to try to do a parallel install on another system and systematically check the ownership and settings of all folders. If you are sure your postgres server is running then try to login by specifying the host as localhost.
I had already done this, but somehow worked this time. However, I did not have that issue as I never even had postgres installed in my system properly. I cannot guess why that part didn't work or ceased to work on your system. I'm hoping you might give it a look over and possibly share any further insights from what you find. Please have a look at the many suggestions in that topic.
Also after the manual migration they propose which does work but I found there was no longer a table for my user. This might provide some perspective on how to fix it before you take the catastrophic approach I did. There is a setting in postgresql. You have to see what kind of connection is your server accepting. This happened to me when I was running postgres instance on docker. See system logs and 'systemctl status postgresql 11-main. I am a newbie here and to the server administration.
The error in its entirety reads: psql: could not connect to server: No such file or directory. When I changed it back to 5432, it worked as expected. This works for me: Edit: postgresql. Hence even though pgadmin and other clients may work, psql will not. The same issue has been raised as a for Hardy and got a fix.
I found that the default folder for the logs was causing a failure. Seems I was on 9. Note that systemctl does not get installed by default on Ubuntu 14. It's been a year since I last muddled with this so I can't remember exactly. Tedious, but you may be able to get access to your data. Sidenote: if you are using activerecord-postgresql-adapter gem, uninstall it first, then re-install pg, then install activerecord-postgresql-adapter again.
In that case you must sudo apt-get autoremove each package 1 by 1. I had a x-window open just for that operation. However, that wasn't the final solution. The error in its entirety reads: psql: could not connect to server: No such file or directory. If you have already messed with those folder ownerships and don't want to completely purge your server, then start tracking the settings for all impacted folders to bring them back to the original state. But somehow systemd got installed on your system.
So following that logic I would expect it to be a bug and it is probably best practice to file a bug on launchpad. The Symlink worked for me in the end but I think I also uninstalled and reinstalled postgres and homebrew in there along the way, so hard to know exactly what made the difference. This is my second time setting up Postgresql via Homebrew on my Mac, and I have no clue what is going on. And this directory had the wrong permissions. This command manually starts the server.
However, I was confident that I was in the same boat as thure. The following is the output I got when I installed it from source. Also, this answer helped me the most: When you run: psql -p 5432 -h localhost it does not use the loopback driver but uses a real socket and hence you need to configure postgres to accept socket connections. It turned out that my solution was far simpler. Possibly uninstall the Ubuntu-supplied packages altogether might be difficult because of other reverse dependencies. A couple of days back I have registered a server with with Ubuntu 11.
If you could help me fix the could not connect to server issue at the top that would be preferred. First, disable all logging settings in postgresql. I don't know of any config file for the psql client. I am not sure if that's relevant. I kept on getting the above error and none of the above solutions worked for me. This is kinda annoying, the first question on any StackExchange site doesn't go well for me.
When you say psql on its own it is attempting to use a socket to connect. If it helps give you a bit more background, homebrew simply runs this script when installing postgres. Although postgres will be installed and it will be the correct version, the script to setup the cluster will not run correctly; it's a packaging issue. That link you included sure is comprehensive, Im not currently having issues with postgres so am not sure how much this is useful to others as yet, but to anyone else if you find this useful, please comment here. Maybe the install of Mountain Lion wiped that out? I got this same error from trying to run psql on the command line. My error was a migration, not a connection issue. Can you elaborate somewhat and give us a bit more background as to what you see the issue really is and how this simple change addresses the issue.