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

Re: Postgre and Web Request

From: Mike Mascari <mascarm(at)mascari(dot)com>
To: Bill Moran <wmoran(at)potentialtech(dot)com>
Cc: Stefan Sturm <mailling(at)anrath(dot)info>, pgsql-general(at)postgresql(dot)org
Subject: Re: Postgre and Web Request
Date: 2004-04-29 13:50:34
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
Bill Moran wrote:

> Stefan Sturm wrote:
>> Hello,
>>> Depending on your web development environment (java, php,
>>> .NET) etc, you should be able to use some mechanism that will
>>> provide a pool of connections to the database. Each request
>>> does not open a new connection (and then release it), but
>>> insteads gets a connection from the pool to use, and returns
>>> it back to the pool when done.
>> Where can I find some examples for connection pooling with php?
>> Or must I just use persistence connections?
> php handles connection pooling more or less automatically ... as
> long as you use pg_pconnect() instead of pg_connect().
> You have to be careful using connection pooling.  For example, if
> you create a temporary table and forget to delete it when the the
> script completes, the next time the script runs, it's likely that
> the connection will be reused and the script will cause an error
> because the temp table already exists.

Gavin Sherry added the ON COMMIT DROP clause to CREATE TEMPORARY 
TABLE in 7.4 which, depending upon the expected life-cycle of the 
temporary table, may prove useful in the above scenario.


Mike Mascari

In response to

pgsql-general by date

Next:From: Mike MascariDate: 2004-04-29 14:00:31
Subject: Re: Performance problem with correlated sub-query
Previous:From: Edmund DenglerDate: 2004-04-29 13:48:10
Subject: Unable to use index?

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