Re: timeout implementation issues

From: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jan Wieck <janwieck(at)yahoo(dot)com>, Jessica Perry Hekman <jphekman(at)dynamicdiagrams(dot)com>, Barry Lind <barry(at)xythos(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: timeout implementation issues
Date: 2002-04-09 01:58:10
Message-ID: 3CB24AB2.D2BDD33B@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian wrote:
>
> Hiroshi Inoue wrote:
> > Bruce Momjian wrote:
> > >
> > > Hiroshi Inoue wrote:
> > > > Bruce Momjian wrote:
> >
> > > > > > > They want the timeout for only the one statement, so they have to set it
> > > > > > > to non-zero before the statement, and to zero after the statement.
> > > > > >
> > > > > > Does setQueryTimeout() issue a corresponding SET QUERY_TIMEOUT
> > > > > > command immediately in the scenario ?
> > > > >
> > > > > Yes. If we don't make the SET rollback-able, we have to do all sorts of
> > > > > tricks in jdbc so aborted transactions get the proper SET value.
> > > >
> > > > In my scenario, setQueryTimeout() only saves the timeout
> > > > value and issues the corrsponding SET QUERY_TIMEOUT command
> > > > immediately before each query if necessary.
> > >
> > > Yes, we can do that,
> >
> > Something like my scenario is needed because there could be
> > more than 1 statement objects with relatively different
> > query timeout at the same time in theory.
>
> Yes, if you want multiple timeouts, you clearly could go in that
> direction. Right now, we are considering only single-statement timing
> and no one has asked for multiple timers.

I don't ask multiple timers. ODBC driver would be able
to handle multiple timeouts without multiple timers in
my scenario.

> > > but it requires an interface like odbc or jdbc. It
> > > is hard to use for libpq or psql.
> >
> > We shouldn't expect too much on psql in the first place
> > because it isn't procedural. I don't expect too much on
> > libpq either because it's a low level interface. However
> > applications which use libpq could do like odbc or jdbc
> > does. Or libpq could also provide a function which encap-
> > sulates the query timeout handling if necessary.
>
> I certainly would like _something_ that works in psql/libpq,

Please don't make things complicated by sticking to such
low level interfaces.

regards,
Hiroshi Inoue

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-04-09 01:59:01 Re: timeout implementation issues
Previous Message Tatsuo Ishii 2002-04-09 01:23:42 Re: unknownin/out patch (was [HACKERS] PQescapeBytea is