Re: implementing query timeout

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Ed Loehr <ed(at)LoehrTech(dot)com>
Cc: dave(at)fastcrypt(dot)com, Matthew Kennedy <mkennedy(at)opushealthcare(dot)com>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: implementing query timeout
Date: 2002-07-10 04:05:13
Message-ID: 200207100405.g6A45Db12495@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Here is my first draft of a query timeout SET variable. It works for a
simple test:

test=> set query_timeout to '2000';
SET
test=> select * from pg_class, pg_type;
ERROR: Query was cancelled.
test=>

I still need to polish it up and do more testing. Can people comment on
the proper placement of the disable_sig_alarm(true) calls? Also, the
handling of the alarm is tricky because the deadlock timer uses the
alarm as well and the query_timeout. (I have not gotten all the cases
correct yet.)

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

Attachment Content-Type Size
unknown_filename text/plain 16.1 KB

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Brent Verner 2002-07-10 06:12:14 COPY with column list
Previous Message Christopher Kings-Lynne 2002-07-10 03:03:53 Re: New Full Text Index using contrib/fulltextindex which now able to processing Traditional Chinese characters(Big5 encoding)