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

Re: Open connections

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: (view raw, whole thread or download thread mbox)
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

In response to

pgsql-jdbc by date

Next:From: Kris JurkaDate: 2004-12-28 20:24:43
Subject: Re: openoffice and boolean
Previous:From: tonyDate: 2004-12-28 18:12:18
Subject: Re: openoffice and boolean

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