pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas F. O'Connell <tfo@sitening.com>
To: pgsql-admin@postgresql.org
Cc: Andrew Watters <andrew@gocontent.com>
Subject: Re: Open connections details
Date: Sun, 13 Nov 2005 21:05:13 -0600
Message-ID: <72014942-5C4F-491B-9F8F-DEB7EC8B9E63@sitening.com> (raw)
In-Reply-To: <9e4684ce0511082224i52cdc6b8te0de74f779dd2968@mail.gmail.com>
References: <43708D73.3070708@gocontent.com>
	<9e4684ce0511082224i52cdc6b8te0de74f779dd2968@mail.gmail.com>


On Nov 9, 2005, at 12:24 AM, hubert depesz lubaczewski wrote:

> On 11/8/05, Andrew Watters <andrew@gocontent.com> wrote:
> I am trying to find details about open connections. I can see that  
> there
> are open connections through Tools | Server Status in pgAdmin III. How
> can I find what the current and/or last SQL statement was that was run
> in those open connections please?
>
> select * from pg_stat_activity;
> you might have to turn on stats_command_string in postgresql.conf.

Depending on how you need to access the information, you should also  
check out the logging options available to you:

http://www.postgresql.org/docs/8.1/static/runtime-config- 
logging.html#RUNTIME-CONFIG-LOGGING-WHAT

log_line_prefix has a variety of potentially relevant options that  
can be used in combination with log_statement.

--
Thomas F. O'Connell
Database Architecture and Programming
Co-Founder
Sitening, LLC

http://www.sitening.com/
110 30th Avenue North, Suite 6
Nashville, TN 37203-6320
615-469-5150
615-469-5151 (fax)

view thread (3+ messages)

Message-ID: <72014942-5C4F-491B-9F8F-DEB7EC8B9E63@sitening.com>
Permalink:  ../72014942-5C4F-491B-9F8F-DEB7EC8B9E63@sitening.com/
Also on:    postgresql.org/message-id/72014942-5C4F-491B-9F8F-DEB7EC8B9E63@sitening.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tfo@sitening.com, andrew@gocontent.com
  Subject: Re: Open connections details
  In-Reply-To: <72014942-5C4F-491B-9F8F-DEB7EC8B9E63@sitening.com>
  References: <43708D73.3070708@gocontent.com> <9e4684ce0511082224i52cdc6b8te0de74f779dd2968@mail.gmail.com> <72014942-5C4F-491B-9F8F-DEB7EC8B9E63@sitening.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox