Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

Responses

pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group