Dennis <dennis(at)zserve(dot)com> writes:
> Is there a way to cleanly shut down that query from the client or admin
> side?
From the client: send a query-cancel request (for example, typing ^C
in psql usually does this).
From the admin: send a SIGINT to the backend running the query, which
has the same effect as a query-cancel request.
regards, tom lane