(PHP 4 >= 4.2.0, PHP 5)
pg_cancel_query() cancel asynchronous query sent by pg_send_query(). You cannot cancel query executed by pg_query().
See also pg_send_query() and pg_connection_busy().