pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <ringerc@ringerc.id.au>
To: feng.zhou <feng.zhou@wellintech.com>
Cc: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Re: Query Timeout Question
Date: Fri, 09 Dec 2011 10:27:50 +0800
Message-ID: <4EE17226.40206@ringerc.id.au> (raw)
In-Reply-To: <201112090944451236494@wellintech.com>
References: <201112090944451236494@wellintech.com>

On 12/09/2011 09:44 AM, feng.zhou wrote:
> Hi
> I set query timeout in code by using SQLSetStmtAttr ODBC API .
> SQLSetStmtAttr( StatementHandle, SQL_ATTR_QUERY_TIMEOUT, (SQLPOINTER)timeout, 0 ) 
> ;
> SQLExecute(StatementHandle);
> But I find this setting has no effect.Before adding timeout setting, 
> SQLExecute costs 47 seconds.After adding timeout, costing time is same.

First: You're using a very old patch release with known bugs. Update to 
8.4.10 .

As for the timeout: PostgreSQL doesn't support query timeouts. It 
supports a session-level statement timeout. I don't know whether the 
ODBC driver uses that or not. Examine the ODBC `mylog' output after 
enabling psqlODBC debugging, and examine the server log after turning on 
query logging, so you can see what the ODBC driver actually asks the 
server for when you set a query timeout.

--
Craig Ringer

view thread (4+ messages)  latest in thread

Message-ID: <4EE17226.40206@ringerc.id.au>
Permalink:  ../4EE17226.40206@ringerc.id.au/
Also on:    postgresql.org/message-id/4EE17226.40206@ringerc.id.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: ringerc@ringerc.id.au, feng.zhou@wellintech.com
  Subject: Re: Query Timeout Question
  In-Reply-To: <4EE17226.40206@ringerc.id.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox