Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 3440E63253F for ; Thu, 3 Jun 2010 12:56:14 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 31534-04 for ; Thu, 3 Jun 2010 15:56:06 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34]) by mail.postgresql.org (Postfix) with SMTP id 2ECBE633076 for ; Thu, 3 Jun 2010 12:56:05 -0300 (ADT) Received: (qmail 30876 invoked by uid 512); 3 Jun 2010 15:56:04 -0000 X-Authentication: inoue was authenticated by sd.tpf.co.jp at 3 Jun 2010 15:56:04 -0000 Received: from unknown (HELO ?192.168.24.52?) (183.76.20.107) by sd.tpf.co.jp with SMTP; 3 Jun 2010 15:56:04 -0000 Message-ID: <4C07D083.8010605@tpf.co.jp> Date: Fri, 04 Jun 2010 00:55:47 +0900 From: Hiroshi Inoue User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; ja; rv:1.8.1.24) Gecko/20100228 Thunderbird/2.0.0.24 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: Mike Toews CC: pgsql-odbc@postgresql.org Subject: Re: Connection Timeout References: <4C076F51.9060202@tpf.co.jp> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.657 tagged_above=-10 required=5 tests=BAYES_40=-0.001, DNS_FROM_RFC_BOGUSMX=1.668, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: * X-Archive-Number: 201006/9 X-Sequence-Number: 10309 Mike Toews wrote: > On 3 June 2010 02:01, Hiroshi Inoue > wrote: > > > What kind of tool(e.g. ADO, ADO.NET on Windows) are > you using? > > regards, > Hiroshi Inoue > > > I'm using the PostgreSQL Unicode ODBC driver with Python (pyodbc) and > VBA (ADO). I get the same 18 second timeout with both, regardless of > what I provide in the connection string. In VBA, there is a > ConnectionTimeout property, but it does not seem to have any influence, > e.g.: > > ' With added reference Microsoft ActiveX Data Objects 2.x Library > Sub test() > Dim Conn As New ADODB.Connection > Dim ConnStr as String > ConnStr = "Driver={PostgreSQL > Unicode};Server=123.4.5.6;Port=5432;Database=mydb;Uid=myid;Pwd=mypw;Timeout=5" > Conn.CommandTimeout = 5 Please set the ConnectionTimeout preperty not the CommandTimeout one. It seems to work here. > Conn.ConnectionString = ConnStr > Conn.Open > Debug.Print "connected" > Conn.Close > Set Conn = Nothing > End Sub > > It takes 15 seconds to throw an error at "Conn.Open, since the host is > invalid. > > pyodbc has a Connection.timeout property, but it is for query timeout. > > -Mike