Re: Checking what is the current query running

Поиск
Список
Период
Сортировка
От Dilipkumar
Тема Re: Checking what is the current query running
Дата
Msg-id 0b6f01c6afd3$42667910$4d7ad2d2@sifydba
обсуждение исходный текст
Ответ на Checking what is the current query running  ("Marco Bizzarri" <marco.bizzarri@gmail.com>)
Ответы Re: Checking what is the current query running
Список pgsql-admin
HI,
 
Is there any way to log all the queries in  7.1.1 (older release).please help out guys.
 
Thanks & Regards
Dilipkumar
----- Original Message -----
Sent: Tuesday, July 25, 2006 2:26 PM
Subject: Re: [ADMIN] Checking what is the current query running

You have to enable "stats_command_string' in your postgresql.conf file:

stats_command_string = on

After that is done you can view queries running on database server like this:

select current_query from pg_stat_activity;

You can also get the query execution times and which queries were run, in the database server logs files by enabling the following in postgresql.conf file:

log_duration = on
log_statement = 'all'

Hope this helps...

Thanks,

Shoaib Mir
EnterpriseDB


On 7/25/06, Marco Bizzarri <marco.bizzarri@gmail.com > wrote:
Hi all.

I've a postgresql where sometimes a process can remaing running a
query for a very long time.

Aside from logging the queries, is there a way to know which query is
running in one particular moment?

Regards
Marco

--
Marco Bizzarri
http://notenotturne.blogspot.com/

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

В списке pgsql-admin по дате отправления:

Предыдущее
От: adey
Дата:
Сообщение: Re: UTF8 characters
Следующее
От: zz_11@mail.bg
Дата:
Сообщение: startup script for FreeBSD 6.1