Ads were blocked by your webbrowser.

This is not a problem, but keep in mind that developing HeidiSQL, user support and hosting takes time and money.

You may want to send a donation instead.

Postgres. Query kill button crashes Heidi.

roger_ackroyd's profile image roger_ackroyd posted 5 years ago in General
Heidi issues a KILL statement but there is no KILL in PostgreSQL.
This forum post relates to the issue.
http://stackoverflow.com/questions/11291456/heroku-postgres-terminate-hung-query-idle-in-transaction

Current version 4820
roger_ackroyd's profile image roger_ackroyd posted 5 years ago
This is rather a nasty issue as it hangs this machine entirely and requires a hard re-boot.
I think the KILL statement takes the Postgres server down altogether.
At present, don't use the kill button to try and terminate a hung query when using PG. Better still make sure your queries are complete before you issue them.
I am something of a novice here and I can only learn from my own mistakes.
Heidi is a great tool and a credit to it's authors.
ansgar's profile image ansgar posted 5 years ago
Is there some similar query in PostgreSQL to cancel a query?


Ads were blocked by your webbrowser.

This is not a problem, but keep in mind that developing HeidiSQL, user support and hosting takes time and money.

You may want to send a donation instead.
ansgar's profile image ansgar posted 5 years ago
... or to disconnect a session?
roger_ackroyd's profile image roger_ackroyd posted 5 years ago
Is this of any help here?
http://www.postgresql.org/docs/current/static/functions-admin.html#FUNCTIONS-ADMIN-SIGNAL-TABLE
ansgar's profile image ansgar posted 5 years ago
I'll give it a try.
ansgar's profile image ansgar posted 5 years ago
Try r4823
roger_ackroyd's profile image roger_ackroyd posted 5 years ago
Thanks Ansgar, that seems to solve the issue.
MaXyM's profile image MaXyM posted 5 years ago
Please note '<IDLE> in transaction' is/might be a valid state.
It means some transaction has been opened but no query is executed.

It's enough to send BEGIN statement to turn current connection into '<IDLE> in transaction'. In normal conditions, using COMMIT or ROLLBACK should be enough.

but if something went wrong (might be some automated process or so) since there is no query, you cannot cancel query using pg_cancel_backend(pid). You have to use pg_terminate_backend(pid). But it kills connection between client and database.

Please login to leave a reply, or register at first.