Skip site navigation (1) Skip section navigation (2)

Re: pg_connect(): Cannot create new link

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: <mauro(dot)folcarelli(at)sistinf(dot)it>
Cc: <pgsql-php(at)postgresql(dot)org>
Subject: Re: pg_connect(): Cannot create new link
Date: 2004-01-16 17:42:47
Message-ID: Pine.LNX.4.33.0401161041370.27657-100000@css120.ihs.com (view raw or flat)
Thread:
Lists: pgsql-php
On Wed, 14 Jan 2004 mauro(dot)folcarelli(at)sistinf(dot)it wrote:

> I have the same problem posted by James Ward (Date: Mon, 15 Sep 2003)
> 
> I migrated from (postgresql-7.3.2-3 and php-4.2.2-17) to
>  (postgresql-7.3.4-2 and php-4.3.3-6).
> 
> When I connect to the Database via php, I get the following message:
> 
> Warning: pg_connect(): Cannot create new link. Too many open links (0).
> 
> I didn't change any configuration file: everything used to work.
> It's the first connection to the database
> (max connections should be 32 by default).
> 
> Is it a bug ? Any solution?
> Is there a chance to bypass it?

What does

ps ax|grep postgres|wc -l

say?  If it says 34 or so, then yes, you have that many connections.  You 
may have a problem with your apache processes hanging / dying oddly and 
keeping the postgresql connections open.  restart postgresql with

pg_ctl -m fast stop
pg_ctl start

and see if you can connect.


In response to

pgsql-php by date

Next:From: ljbDate: 2004-01-17 01:04:39
Subject: Re: pg_connect(): Cannot create new link
Previous:From: Enrico OrtmannDate: 2004-01-16 10:30:23
Subject: can't create db

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group