Обсуждение: Open connections details

Поиск
Список
Период
Сортировка

Open connections details

От
Andrew Watters
Дата:
Hi

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?

Thanks for your help
Andrew


Re: Open connections details

От
hubert depesz lubaczewski
Дата:
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.

depesz

Re: Open connections details

От
"Thomas F. O'Connell"
Дата:

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:


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

110 30th Avenue North, Suite 6
Nashville, TN 37203-6320
615-469-5150
615-469-5151 (fax)