From: | Kris Jurka <books(at)ejurka(dot)com> |
---|---|
To: | Scott Marlowe <smarlowe(at)g2switchworks(dot)com> |
Cc: | Nico <nicohmail-postgresql(at)yahoo(dot)com>, pgsql-jdbc(at)postgresql(dot)org |
Subject: | Re: Open connections |
Date: | 2004-12-28 20:23:04 |
Message-ID: | Pine.BSO.4.56.0412281518040.25456@leary.csoft.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
On Tue, 28 Dec 2004, Scott Marlowe wrote:
> Assuming that stats_row_level = true is set in the postgresql.conf file,
> you can find out with:
>
> SELECT * from pg_stat_activity;
>
pg_stat_activity does not require row level stats. To get the command
string in this view you need stats_command_string enabled, but again
that's not necessary to just see open connections.
This method doesn't seem like a real solution to the problem at hand
though. How are you going to determine if you are allowed to make a
connection to the database? By making a connection to the database and
querying this view? Note also that the pg_stat_activity view lags reality
by up to a half a second. Note also that the max_connections setting is
per cluster, not per database, so you cannot know or control what other
clients are going to do with other databases.
I would definitely consider a connection pool as others have
suggested and possibly moving away from frames entirely.
Kris Jurka
From | Date | Subject | |
---|---|---|---|
Next Message | Kris Jurka | 2004-12-28 20:24:43 | Re: openoffice and boolean |
Previous Message | tony | 2004-12-28 18:12:18 | Re: openoffice and boolean |