Rasmus Mohr <rmo@Netpointers.com> writes:
> Hi, we have serious problem with our postgresql db.
> A staling query were killed and all the WAL files were deleted.
Just for the benefit of onlookers: that was a really BAD idea.
The pg_xlog and pg_clog files are not optional; you *will* regret it
if you decide to delete 'em.
BTW, if you want to kill a runaway query, it's usually sufficient
to do "kill -INT" on the specific backend doing the query. This
executes a query-cancel, which should stop the query fairly quickly
without any damage to the rest of the system.
regards, tom lane