Re: Disconnect - required, recommended, or optional?

Поиск
Список
Период
Сортировка
От John DeSoi
Тема Re: Disconnect - required, recommended, or optional?
Дата
Msg-id 20633C46-A536-11D9-8FA8-000A95B03262@pgedit.com
обсуждение исходный текст
Ответ на Disconnect - required, recommended, or optional?  ("Rodolfo J. Paiz" <rpaiz@simpaticus.com>)
Список pgsql-novice
On Apr 4, 2005, at 12:40 PM, Rodolfo J. Paiz wrote:

> I've just noticed that there is a disconnect function in PEAR's DB
> module. For web pages (written in PHP) that connect to PostgreSQL,
> should I *always* disconnect when finished with that page's queries? Or
> is it pretty much optional, or only used in high-traffic situations
> where resource exhaustion is a concern?

I would say optional. The command is there if you need it (suppose you
have a long running script or open a lot of different connections), but
the connections are automatically released at the end of the script.
For scripts with a web page view type lifetime, I don't see the need to
worry about it. Here is what the php docs say about pg_close:

Note:  Using pg_close() is not usually necessary, as  non-persistent
open connections are automatically closed at the end  of the script.


John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


В списке pgsql-novice по дате отправления:

Предыдущее
От: Richmond Dyes
Дата:
Сообщение: I am verynew to postgresql problem with defining blob field
Следующее
От: "Morgan Kita"
Дата:
Сообщение: Re: Major problem with custom data type