Re: any way to query for current connections to db?

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "Coarr, Matt" <mcoarr(at)mitre(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: any way to query for current connections to db?
Date: 2007-11-09 22:58:16
Message-ID: dcc563d10711091458u24844acejf22bf728ed0be869@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Nov 9, 2007 4:36 PM, Coarr, Matt <mcoarr(at)mitre(dot)org> wrote:
>
> Is there any way to query the database to identify what the current
> connections are (connections, sessions, or whatever you want to call them)?
>
> This would be something similar to oracle's v$session view.

select * from pg_stat_activity where datname='mydbname'

should get you started.

You can see all the system tables with
\dS
in psql

In response to

Browse pgsql-general by date

  From Date Subject
Next Message volunteer 2007-11-09 23:00:27 Re: any way to query for current connections to db?
Previous Message Bruce Momjian 2007-11-09 22:57:40 Re: any way to query for current connections to db?