This manual has been available on this site since about 1996, with improvements taking place frequently. The current version has been published as a book of about 350 pages by Cambridge University Press. By agreement with the Press, however, it will remain posted on this web site. Many improvements in the current version over previous ones are due to the (anonymous) referees of the Press, whom I wish to thank heartily. I also wish to thank Lauren Cowles, of the New York office of the Press, for much help with preparing the original version for publication. The paper edition appears also in Duotone red and black. For information on obtaining the paper edition, take a look at the Cambridge Press catalogue.
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;