Re: Current query of the PL/pgsql procedure.

Поиск
Список
Период
Сортировка
От Craig James
Тема Re: Current query of the PL/pgsql procedure.
Дата
Msg-id CAFwQ8rcqt3u+FQMFig54JNq6R-QWgf3UatTT5PjeN=5QDtOHkw@mail.gmail.com
обсуждение исходный текст
Ответ на Current query of the PL/pgsql procedure.  (Yuri Levinsky <yuril@celltick.com>)
Список pgsql-performance
On Sun, Dec 15, 2013 at 8:18 AM, Yuri Levinsky <yuril@celltick.com> wrote:

Dear ALL,

I am running PL/pgsql procedure with sql statements that taking a long time. I able to see them in the log just after their completion. How can I see currently running SQL statement?  I am able to see in pg_stat_activity only my call to function. Many thanks in advance.


pg_stat_activity is the right table, but you have to be the super-user to see queries by others.  Here's what I use:

$ psql -U postgres
postgres=# select procpid, datname, usename, current_query from pg_stat_activity where current_query !~ '<IDLE>';

 Craig

 

Sincerely yours,

 

Description: Celltick logo_highres

Yuri Levinsky, DBA

Celltick Technologies Ltd., 32 Maskit St., Herzliya 46733, Israel

Mobile: +972 54 6107703, Office: +972 9 9710239; Fax: +972 9 9710222

 


Вложения

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

Предыдущее
От: Yuri Levinsky
Дата:
Сообщение: Current query of the PL/pgsql procedure.
Следующее
От: hubert depesz lubaczewski
Дата:
Сообщение: Re: Current query of the PL/pgsql procedure.