postgresql statement taking ages to cancel in pgAdmin III
PostgreSQL generally does not visibly respond to cancellation requests while it is inside an externally-defined function.  It will simply set a flag, and then process the request between calls to ST_UNION, but not within them.