Thread: createdb errors and more
Today I restarted to install postgres from scratch, because I have a lot of installation problems. To summarize my system: I have two xubuntu logins: a "superuser" and postgres. The latter one is a user with basic privileges. I installed pgsql according to the manual, generated a data folder, changed ownership to postgres, switched user postgresand initialized the database. starting the database is also successful (status says running). But now: when I use the command createdb test, I get the error "can't connect to database postgres: could not connect toserver: no such file or directory, Is the server running locally and accepting .... etc." When I switch user back to "superuser" I can start the server, add users etc. in pgAdmin3. But I need to be able to do thisfrom the command line. PLEASE help, I am getting really frustrated with this system, it already took me 2 weeks and still didn't get it right. Another thing I can't get done: I created the postgresql init script in /etc/init.d/ When I reboot, the database is not automatically started. Do I need to login in the linux postgres account to let this happen?The database should also start in the background even when I login into another account? Should the data dir only be owned by postgres or the entire /usr/local/pgsql dir?? Again, hopefully somebody can push me in the right direction. Thanks, reno ************************************************************************************************** This email and any attachments may contain confidential or privileged information and is intended for the addressee only. If you are not the intended recipient, please immediately notify us by email or telephone and delete the original email and attachments without using, disseminating or reproducing its contents to anyone other than the intended recipient. The azM shall not be liable for the incorrect or incomplete transmission of this email or any attachments, nor for unauthorized use by its employees. **************************************************************************************************
On Mon, Nov 16, 2009 at 17:55, Reno Bladergroen <reno.bladergroen@telenet.be> wrote: > I installed pgsql according to the manual, generated a data folder, changed ownership to postgres, switched user postgresand initialized the database. starting the database is also successful (status says running). [...] I assume you are talking about the steps similiar to the ones listed under 14.1 Short Version here; http://www.postgresql.org/docs/8.0/interactive/installation.html. If so, peek around the logfile produced for postmaster and see if you can find anything useful in there. To me, the problems sounds like the initdb-command failed somehow, since you get the message "could not connect to server", but it could also mean that the server actually did not start. What happens if you do "telnet localhost 5432"? If you get a reply, the server is atleast up and running. -- - Rikard
On Mon, 2009-11-16 at 17:55 +0100, Reno Bladergroen wrote: > Today I restarted to install postgres from scratch, because I have a lot of installation problems. To summarize my system: > I have two xubuntu logins: a "superuser" and postgres. The latter one is a user with basic privileges. > I installed pgsql according to the manual, generated a data folder, changed ownership to postgres, switched user postgresand initialized the database. starting the database is also successful (status says running). > But now: when I use the command createdb test, I get the error "can't connect to database postgres: could not connect toserver: no such file or directory, Is the server running locally and accepting .... etc." > When I switch user back to "superuser" I can start the server, add users etc. in pgAdmin3. But I need to be able to dothis from the command line. > PLEASE help, I am getting really frustrated with this system, it already took me 2 weeks and still didn't get it right. > > Another thing I can't get done: I created the postgresql init script in /etc/init.d/ > When I reboot, the database is not automatically started. Do I need to login in the linux postgres account to let thishappen? The database should also start in the background even when I login into another account? > Should the data dir only be owned by postgres or the entire /usr/local/pgsql dir?? > > Again, hopefully somebody can push me in the right direction. Sounds to me that you have postgres from xubuntu and postgres from source installed. Don't use source unless you have to. Joshua D. Drake > > Thanks, reno > > > > ************************************************************************************************** > This email and any attachments may contain confidential or privileged > information and is intended for the addressee only. If you are not the > intended recipient, please immediately notify us by email or telephone and > delete the original email and attachments without using, disseminating or > reproducing its contents to anyone other than the intended recipient. The > azM shall not be liable for the incorrect or incomplete transmission of this > email or any attachments, nor for unauthorized use by its employees. > ************************************************************************************************** > > -- PostgreSQL.org Major Contributor Command Prompt, Inc: http://www.commandprompt.com/ - 503.667.4564 Consulting, Training, Support, Custom Development, Engineering If the world pushes look it in the eye and GRR. Then push back harder. - Salamander
Reno Bladergroen <reno.bladergroen@telenet.be> writes: > I have two xubuntu logins: a "superuser" and postgres. The latter one is a user with basic privileges. > I installed pgsql according to the manual, generated a data folder, changed ownership to postgres, switched user postgresand initialized the database. starting the database is also successful (status says running). > But now: when I use the command createdb test, I get the error "can't connect to database postgres: could not connect toserver: no such file or directory, Is the server running locally and accepting .... etc." > When I switch user back to "superuser" I can start the server, add users etc. in pgAdmin3. But I need to be able to dothis from the command line. Stop the postmaster so that createdb fails for both logins, and compare the error messages --- are they pointing to the same socket file? I suspect JD's diagnosis is right: you probably have got two postgres installations (or parts of two at least) with different ideas of where the communication socket should be. > When I reboot, the database is not automatically started. "man chkconfig" might help you with this one. Linux systems are not normally made to auto-start services unless they're very specifically requested. By and large, it's a lot less painful to use a preconfigured package than to try to install from source. regards, tom lane
eh... no I installed once from source, because the package-manager failed to install the main application (PostgreSQL 8.3).Somehow it could not configure (after a few minutes the make command ended and an error popped up). Therefore I hadto start from source, which did work. Today after getting this error message time after time I did start all over again and executed the ./configure-make-makeinstall sequence again. Can that be harmful? Should I uninstall completely before doing that? Unless this is an unstable system, I did get it running! The end-application is connecting and working. Thanks for your help, Reno ************************************************************************************************** This email and any attachments may contain confidential or privileged information and is intended for the addressee only. If you are not the intended recipient, please immediately notify us by email or telephone and delete the original email and attachments without using, disseminating or reproducing its contents to anyone other than the intended recipient. The azM shall not be liable for the incorrect or incomplete transmission of this email or any attachments, nor for unauthorized use by its employees. **************************************************************************************************
On Mon, Nov 16, 2009 at 9:55 AM, Reno Bladergroen <reno.bladergroen@telenet.be> wrote: > Today I restarted to install postgres from scratch, because I have a lot of installation problems. To summarize my system: > I have two xubuntu logins: a "superuser" and postgres. The latter one is a user with basic privileges. > I installed pgsql according to the manual, generated a data folder, changed ownership to postgres, switched user postgresand initialized the database. starting the database is also successful (status says running). > But now: when I use the command createdb test, I get the error "can't connect to database postgres: could not connect toserver: no such file or directory, Is the server running locally and accepting .... etc." Ooops, you left out the part where you tell us what you did. Seeing your createdb switches etc would help a lot. Better to give us too much info than not enough.
On Mon, 2009-11-16 at 17:55 +0100, Reno Bladergroen wrote: > Today I restarted to install postgres from scratch, because I have a lot of installation problems. To summarize my system: > I have two xubuntu logins: a "superuser" and postgres. The latter one is a user with basic privileges. > I installed pgsql according to the manual, generated a data folder, changed ownership to postgres, switched user postgresand initialized the database. starting the database is also successful (status says running). > But now: when I use the command createdb test, I get the error "can't connect to database postgres: could not connect toserver: no such file or directory, Is the server running locally and accepting .... etc." > When I switch user back to "superuser" I can start the server, add users etc. in pgAdmin3. But I need to be able to dothis from the command line. > PLEASE help, I am getting really frustrated with this system, it already took me 2 weeks and still didn't get it right. > > Another thing I can't get done: I created the postgresql init script in /etc/init.d/ > When I reboot, the database is not automatically started. Do I need to login in the linux postgres account to let thishappen? The database should also start in the background even when I login into another account? > Should the data dir only be owned by postgres or the entire /usr/local/pgsql dir?? > > Again, hopefully somebody can push me in the right direction. Sounds to me that you have postgres from xubuntu and postgres from source installed. Don't use source unless you have to. Joshua D. Drake > > Thanks, reno > > > > ************************************************************************************************** > This email and any attachments may contain confidential or privileged > information and is intended for the addressee only. If you are not the > intended recipient, please immediately notify us by email or telephone and > delete the original email and attachments without using, disseminating or > reproducing its contents to anyone other than the intended recipient. The > azM shall not be liable for the incorrect or incomplete transmission of this > email or any attachments, nor for unauthorized use by its employees. > ************************************************************************************************** > > -- PostgreSQL.org Major Contributor Command Prompt, Inc: http://www.commandprompt.com/ - 503.667.4564 Consulting, Training, Support, Custom Development, Engineering If the world pushes look it in the eye and GRR. Then push back harder. - Salamander