Reputation: 3910
Update 2 - I have uninstalled and reinstalled the packages from within root (i.e. su), rather than sudo-ing in with my own account. This allowed executables to be run from /tmp, which got rid of the error from the first update.
Update - Just tried uninstalling and reinstalling (apt-get remove --purge postgresql, then apt-get install postgresql postgresql-contrib postgresql-client) and got this error, which I suspect is related to my problems:*
Can't exec "/tmp/postgresql-common.config.32601": Permission denied at /usr/share/perl/5.14/IPC/Open3.pm line 186.
open2: exec of /tmp/postgresql-common.config.32601 configure failed at /usr/share/perl5/Debconf/ConfModule.pm line 59
I am having trouble starting postgreSQL and was hoping to get some help.
I've already studied the answers and comments from the following posts - and tried pg_dropcluster and pg_createcluster - but have had no luck configuring postgreSQL 9.1 to start on Ubuntu 12.04. (I was able to setup and configure postgreSQL on windows with no problems, however.)
- I should note the answer given here seems helpful, but since I'm new to Linux, I couldn't follow it. I also wonder if there is an easier way. The OP has also not accepted an answer, so I am not sure if this actually solves the problem.
Postgresql changing data directory in ubuntu
I suspect that the OP had the exact same problem that I am having, since I am getting the same error messages, and there is also no log file output despite the error message in the terminal.
pg_ctl: could not start server
Examine the log output.
PostgreSQL 9.1 did not start in a timely fashion, please see opt/PostgreSQL/9.1/data/pg_log/startup.log for details
Upvotes: 4
Views: 10917
Reputation: 3910
Of all the tutorials on the web, this is the one that finally worked for me.
I did a "pg_dropcluster 9.1 main", and then "pg_createcluster 9.1 main start", and then followed it EXACTLY.
The main difference being that the other tutorials fail to create a user within postgresql, instead, only creating a user within unix. Perhaps this is a due to version differences. Again, I am using postgresql 9.1.5 and am on ubuntu 12.04.
ALSO... Don't forget to apt-get install libpq-dev
Hope this helps anyone else in my situation.
Upvotes: 6