Re: Re: [SQL] Query Timeout Question

From: feng(dot)zhou <feng(dot)zhou(at)wellintech(dot)com>
To: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
Cc: pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Re: [SQL] Query Timeout Question
Date: 2011-12-09 02:51:02
Message-ID: 201112091051021748801@wellintech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Thanks for your reply.
if timeout setting doesn't be supported, How to solve this question that the client is hung for long time when executing time-comsuming query or query a locked table.

2011-12-09

feng.zhou

发件人: Craig Ringer
发送时间: 2011-12-09 10:05:44
收件人: feng.zhou
抄送: pgsql-sql
主题: Re: [SQL] Query Timeout Question

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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Emre Hasegeli 2011-12-09 09:39:07 Re: Question on imports with foreign keys
Previous Message Craig Ringer 2011-12-09 02:27:50 Re: Query Timeout Question