PostgreSQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesPostgreSQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 17th, 2002, 01:41 AM
pablo.gosse pablo.gosse is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Posts: 155 pablo.gosse User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 6 m 5 sec
Reputation Power: 11
pg_connect() unable to connect to PostgreSQL server

Hi all. This might seem like a php question by the title but it's answer lies within postgres.

When I try to connect I get the following error:

Warning: pg_connect() unable to connect to PostgreSQL server: Connection refused. Is the server running on localhost and accepting TCP/IP connections on port 5432?

I'm quite new to having to administer postgresql so I've no idea how to check that, and haven't been able to find anything of much use online.

Can anyone give any advice?

Thanks in advance,
Pablo

Reply With Quote
  #2  
Old December 18th, 2002, 01:20 PM
niico.c niico.c is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: France
Posts: 55 niico.c User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 11
Re: pg_connect() unable to connect to PostgreSQL server

I see 3 possibilities to fix your problem :

1 - Check the postmaster is launched with the -i option. It means it can get tcp/ip connections

2 - Look into the pg_hba.conf file in the pgsql folder (/var/log/pgsql under redhat). This file manages access to the postmaster. The syntax is explained inside it.

3 - If the postmaster is on the same system as apache I think u may connect it through unix sockets, not tcp/ip. BTW, what is your connection string?

Reply With Quote
  #3  
Old December 18th, 2002, 01:23 PM
pablo.gosse pablo.gosse is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Posts: 155 pablo.gosse User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 6 m 5 sec
Reputation Power: 11
Problem was within the pg_hba.conf file. Needed to add an entry for 127.0.0.1 and all was solved.

Pablo

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesPostgreSQL Help > pg_connect() unable to connect to PostgreSQL server

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap