From: | "Thomas F(dot) O'Connell" <tfo(at)sitening(dot)com> |
---|---|
To: | pgsql-admin(at)postgresql(dot)org |
Cc: | Andrew Watters <andrew(at)gocontent(dot)com> |
Subject: | Re: Open connections details |
Date: | 2005-11-14 03:05:13 |
Message-ID: | 72014942-5C4F-491B-9F8F-DEB7EC8B9E63@sitening.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
On Nov 9, 2005, at 12:24 AM, hubert depesz lubaczewski wrote:
> On 11/8/05, Andrew Watters <andrew(at)gocontent(dot)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)
From | Date | Subject | |
---|---|---|---|
Next Message | bhaskar | 2005-11-14 14:11:29 | Socket error - Could not connect to PostgreSQL server |
Previous Message | Alvaro Herrera | 2005-11-13 19:05:53 | Re: autovacuum on updated rows |