PostgreSQL cannot connect to database

A special forum dedicated to our PT4 for Mac OS X users

Moderators: WhiteRider, kraada, Flag_Hippo, morny, Moderators

PostgreSQL cannot connect to database

Postby madsenma » Fri Apr 12, 2013 11:57 am

I have been using PT3 on my Mac and have the postgres database all set up for that. I am now trying to run the trial of PT4, and when the Configure PostgreSQL Server window comes up and I click Connect it says

"Unable to connect to this database. Please check the configuration."

Please advise!
madsenma
 
Posts: 27
Joined: Thu Aug 18, 2011 1:26 pm

Re: PostgreSQL cannot connect to database

Postby kraada » Fri Apr 12, 2013 12:36 pm

Can you connect to PostgreSQL through PGAdmin? Double check your password options - that error can occur if you're using a different password and the passwords don't match.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: PostgreSQL cannot connect to database

Postby madsenma » Fri Apr 12, 2013 12:42 pm

Sorry, I don't know what PGAdmin is. I'm not very familiar with how the whole PostgreSQL works to be honest.
madsenma
 
Posts: 27
Joined: Thu Aug 18, 2011 1:26 pm

Re: PostgreSQL cannot connect to database

Postby madsenma » Fri Apr 12, 2013 2:02 pm

Ok, I have updated PostgreSQL to version 9.0, found PGAdmin and attempted to connect to the server. I have tried all possible passwords including the default 'dbpass' which I don't imagine I would have changed, and the message is always "Server doesn't listen.....Is the server running on host "localhost" and accepting TCP/IP connections on port 5432?"

If it is a problem of the username/password, is it possible to reset this? Or delete the whole thing and reinstall from fresh? I have tried looking for the uninstaller in the PostgreSQL 9.0 folder but there was none.
madsenma
 
Posts: 27
Joined: Thu Aug 18, 2011 1:26 pm

Re: PostgreSQL cannot connect to database

Postby kraada » Fri Apr 12, 2013 2:30 pm

Let's check first to see if the server is running. Open Applications -> Utilities -> Terminal and at the terminal type:
ps auxw | grep -i postgres

and post the output here for me please.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: PostgreSQL cannot connect to database

Postby delwinloh » Sat Apr 13, 2013 2:10 am

Hi,

I am facing the same issue - cannot connect to database.

This is what I get after keying in 'ps auxw | grep -i postgres'

postgres 55474 0.0 0.1 2471912 9220 ?? SN Thu08PM 0:12.71 /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Versions/A/Support/mdworker -s mdworker -c MDSImporterWorker -m com.apple.mdworker.shared
postgres 350 0.0 0.0 2465740 1156 ?? S Sat05PM 0:01.29 /usr/sbin/cfprefsd agent
postgres 344 0.0 0.0 2483820 1604 ?? S Sat05PM 0:00.46 /usr/sbin/distnoted agent
postgres 336 0.0 0.0 2471372 896 ?? Ss Sat05PM 0:00.81 /sbin/launchd
delwinloh 82229 0.0 0.0 2432768 600 s000 S+ 1:36PM 0:00.00 grep -i postgres

Please assist.

Thanks
delwinloh
 
Posts: 1
Joined: Sat Apr 13, 2013 2:08 am

Re: PostgreSQL cannot connect to database

Postby madsenma » Sat Apr 13, 2013 9:23 am

This is what I get after entering 'ps auxw | grep -i postgres'

iMamo 41180 0.0 0.4 835124 35084 ?? S 6:59pm 0:01.79 /Library/PostgreSQL/9.0/pgAdmin3.app/Contents/MacOS/pgAdmin3 -psn_0_74278610
iMamo 41742 0.0 0.0 2432768 632 s000 S+ 2:22pm 0:00.00 grep -i postgres
madsenma
 
Posts: 27
Joined: Thu Aug 18, 2011 1:26 pm

Re: PostgreSQL cannot connect to database

Postby WhiteRider » Sat Apr 13, 2013 11:39 am

Unfortunately Kraada isn't around this weekend and I'm not sure what this output means exactly.

madsenma wrote:This is what I get after entering 'ps auxw | grep -i postgres'

iMamo 41180 0.0 0.4 835124 35084 ?? S 6:59pm 0:01.79 /Library/PostgreSQL/9.0/pgAdmin3.app/Contents/MacOS/pgAdmin3 -psn_0_74278610
iMamo 41742 0.0 0.0 2432768 632 s000 S+ 2:22pm 0:00.00 grep -i postgres

That doesn't look as if any PostgreSQL processes are actually running.
Please read this guide which walks you through the PostgreSQL installation, and how to fully uninstall first which is necessary if you have a partial installation which isn't working.

delwinloh wrote:Hi,

I am facing the same issue - cannot connect to database.

This is what I get after keying in 'ps auxw | grep -i postgres'

postgres 55474 0.0 0.1 2471912 9220 ?? SN Thu08PM 0:12.71 /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Versions/A/Support/mdworker -s mdworker -c MDSImporterWorker -m com.apple.mdworker.shared
postgres 350 0.0 0.0 2465740 1156 ?? S Sat05PM 0:01.29 /usr/sbin/cfprefsd agent
postgres 344 0.0 0.0 2483820 1604 ?? S Sat05PM 0:00.46 /usr/sbin/distnoted agent
postgres 336 0.0 0.0 2471372 896 ?? Ss Sat05PM 0:00.81 /sbin/launchd
delwinloh 82229 0.0 0.0 2432768 600 s000 S+ 1:36PM 0:00.00 grep -i postgres

Again Kraada may be able to tell more from your output when he returns, but without more information I'm not sure what to suggest. How did you install PostgreSQL on this machine? Depending on your situation you may want to follow the same guide as above.
WhiteRider
Moderator
 
Posts: 54017
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: PostgreSQL cannot connect to database

Postby kraada » Mon Apr 15, 2013 1:02 pm

It looks like you've been running some normal applications as the postgres user - did you log in as that user and try to do things that way? That should not be necessary - PostgreSQL runs as that user in the background.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: PostgreSQL cannot connect to database

Postby madsenma » Tue Apr 16, 2013 6:27 am

Yea the previous PostgreSQL installation required me to change my username to postgres and did not create it as a separate user.

Anyway, managed to solve the problem as advised by WhiteRider - deleted the database and reinstalled postgres, now works a treat. Thanks
madsenma
 
Posts: 27
Joined: Thu Aug 18, 2011 1:26 pm


Return to PT4 for macOS

Who is online

Users browsing this forum: No registered users and 15 guests

cron
highfalutin