ADO CommandTimeout vs Postgres statement_timeout parameter - Mailing list pgsql-odbc

From Richard Hetherington
Subject ADO CommandTimeout vs Postgres statement_timeout parameter
Date
Msg-id DUB125-W35BA25E36CB3CA602B37B3BB490@phx.gbl
Whole thread Raw
Responses Re: ADO CommandTimeout vs Postgres statement_timeout parameter  ("Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>)
List pgsql-odbc
Hi, I have been debugging why the ADO CommandTimeout property has no effect on Postgres Queries and I believe that it is being ignored. Is this something that could be modified in a future ODBC Driver release. What I would like to see is an auto prepending of this value to a SQL Query being passed in if set.

I understand that the statement_timeout config parameter in postgres can be configured at the server level, user level and query level. I have tested each and they work as expected. What I wasn't expecting was for my CommandTimeout to be ignored / not passed through.

e.g.

Set p_objConn = Server.CreateObject("ADODB.Connection")
p_objConn.ConnectionString = "SOME DSN or DSNLess Connection String"
' e.g. DB.ConnectionString = "Driver={PostgreSQL UNICODE};Server=localhost;Port=5432;UID=someuser;PWD=somepassword;Database=somedatabase;"
p_objConn.ConnectionTimeout = 10
p_objConn.Open
p_objConn.CommandTimeout = 30 ' This has no effect on queries run against Postgres !!

If The ADO CommandTimeout value is set, could this be detected, check that the SQL Query hasn't already got a statement_timeout value and if not prepend the SQL Query as follows:

SET statement_timeout = 30000;

SELECT somedata FROM somedatabasetable WHERE somevalue=anothervalue,
Many thanks in advance.

Feel free to contact me if you need any further information.

RICHARD HETHERINGTON

pgsql-odbc by date:

Previous
From: "Venkatesan, Sekhar"
Date:
Subject: Re: PostgreSQL: SQLSetPos fails with SetPos update return error.
Next
From: "Inoue, Hiroshi"
Date:
Subject: Re: PostgreSQL: SQLSetPos fails with SetPos update return error.