Hello, Thank you very much.
Denial of service is indeed a problem. Is there a way to limit the execution time of a request? I'm using libpq to communicate with the server. PS. I've just taken a look, it seems I could do some asynchronous queries, time them, then cancel them if they take too long. http://www.postgresql.org/docs/8.4/static/libpq-cancel.html