Re: How to list what queries are running in postgres?
От | Bruce Momjian |
---|---|
Тема | Re: How to list what queries are running in postgres? |
Дата | |
Msg-id | 200407060227.i662REq15694@candle.pha.pa.us обсуждение исходный текст |
Ответ на | Re: How to list what queries are running in postgres? (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-admin |
Tom Lane wrote: > Gaetano Mendola <mendola@bigfoot.com> writes: > > P.A.M. van Dam wrote: > >> I'm looking for a command or method to find out what queries are > >> currently being serviced by the database. > > > select * from pg_stat_activity; > > ... having first remembered to turn on stats_command_string; and > thou shalt also be superuser. And 7.5 will print out a more helpful message if you forget to set these: test=> select * from pg_stat_activity; datid | datname | procpid | usesysid | usename | current_query | query_start -------+---------+---------+----------+----------+------------------------------+------------- 17227 | test | 15527 | 100 | guest | <command string not enabled> | 17227 | test | 15574 | 1 | postgres | <insufficient privilege> | (2 rows) -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073
В списке pgsql-admin по дате отправления: