Re: timeout implementation issues

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Jessica Perry Hekman <jphekman(at)dynamicdiagrams(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: timeout implementation issues
Date: 2002-04-01 16:22:21
Message-ID: 200204011622.g31GMLY10766@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jessica Perry Hekman wrote:
> > On Sat, 30 Mar 2002, Tom Lane wrote:
> >
> > > Au contraire, it is not assuming anything. It is sending off a cancel
> > > request and then waiting to see what happens. Maybe the query will be
>
> Okay, I see now: when processCancelRequest() is called, a return of 127 is
> sent. That would indeed work; thanks for walking me through it.
>
> My other question was how to send the timeout value to the backend. Bruce
> said at one point:
>
> > Timeout can be part of BEGIN, or a SET value, which would work from
> > jdbc.
>
> I'm not sure how this would work. The timeout value would be sent as part
> of a SQL query?

I think there are two ways of making this capability visible to users.
First, you could do:

SET query_timeout = 5;

and all queries after that would time out at 5 seconds. Another option
is:

BEGIN WORK TIMEOUT 5;
...
COMMIT;

which would make the transaction timeout after 5 seconds. We never
decided which one we wanted, or both.

--
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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-04-01 16:26:19 Re: timeout implementation issues
Previous Message Tom Lane 2002-04-01 16:21:54 Re: NOT IN queries