[Gllug] postgres question

Oliver Howe ojhowe at gmail.com
Mon Aug 22 08:56:16 UTC 2011


I am seeing some waiting postgres processes when users create large select
queries via the web browser.
Often their browser times out, or they leave the page, but the query

When I do a pg_top and then Q to show what the query is doing it shows me
the select is still happening.

I have tried cancelling this select with

SELECT pg_cancel_backend(8354) FROM pg_stat_activity;

where 8354 was the PID of the select process

but it persisted.

so then I did

SELECT pg_terminate_backend(8354) FROM pg_stat_activity;

but this crashed the whole db and I had to restart it.

Is there a better way to cancel such queries?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20110822/a587a820/attachment.html>
-------------- next part --------------
Gllug mailing list  -  Gllug at gllug.org.uk

More information about the GLLUG mailing list