Re: Connections to DB - Mailing list pgsql-general

From Jim C. Nasby
Subject Re: Connections to DB
Date
Msg-id 20051027173736.GG63747@pervasive.com
Whole thread Raw
In response to Connections to DB  ("Onyx" <omueller@i3.com>)
Responses Re: Connections to DB  (Tony Caduto <tony_caduto@amsoftwaredesign.com>)
List pgsql-general
SELECT * FROM pg_stat_activity;

Note that if you turn on stats_command_string you'll also be able to see
what each connection is doing if you're connected as a superuser.

On Thu, Oct 27, 2005 at 11:21:26AM -0600, Onyx wrote:
> How can I view the current, persistent connections to a database?  Is there
> a way to do this with 'psql' or with some other PostgreSQL bundled
> tool/utility (~pgsql_directory/bin), instead of resorting to the underlying
> operating system commands (ie: netstat -a | grep postgres)?
>
> I am interested in finding out the following: 1) How many connections are
> there to the database? 2) How long have they persisted?  3)  What is the
> idle time of the connections?
>
> Any help would be appreciated.  Thanks!
>
>
> - Onyx
> ---
> Onyx Mueller
> Software Engineer
> i-cubed : information integration & imaging LLC
> 201 Linden Street : Third Floor
> Fort Collins, CO  80524
> 970-482-4400 voice
> 970-482-4499 fax
> www.i3.com
>
>

--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

pgsql-general by date:

Previous
From: "Onyx"
Date:
Subject: Connections to DB
Next
From: Kevin Murphy
Date:
Subject: aix build question re: duplicate symbol warning