Connection Timeout
am 01.06.2010 01:13:30 von Mike Toews--000e0cd734647528060487ec02bf
Content-Type: text/plain; charset=ISO-8859-1
Hi,
It doesn't appear there is a connection timeout parameter (e.g.,
ConnString="...;Timeout=5;..."), so I'm not sure how to throw an error
quicker if the driver cannot connect to the host:port. I'm waiting about 18
seconds, which I'd like to reduce to 5 seconds to streamline my program
startup if the postgres server is not available. Did I read the
documentation incorrectly, or are there any plans to introduce a Timeout
parameter? I'm using the latest version (08.04.0200).
There was a similar unanswered question a while ago:
http://archives.postgresql.org/pgsql-odbc/2003-06/msg00025.p hp
-Mike
--000e0cd734647528060487ec02bf
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
on timeout parameter (e.g., ConnString=3D"...;Timeout=3D5;..."), =
so I'm not sure how to throw an error quicker if the driver cannot conn=
ect to the host:port. I'm waiting about 18 seconds, which I'd like =
to reduce to 5 seconds to streamline my program startup if the postgres ser=
ver is not available.=A0Did I read the documentation incorrectly,=A0or are =
there any plans to introduce a Timeout parameter? I'm using the=A0lates=
t version (08.04.0200).
/div>
--000e0cd734647528060487ec02bf--
Re: Connection Timeout
am 03.06.2010 11:01:05 von Hiroshi InoueMike Toews wrote:
> Hi,
>
> It doesn't appear there is a connection timeout parameter (e.g.,
> ConnString="...;Timeout=5;..."), so I'm not sure how to throw an error
> quicker if the driver cannot connect to the host:port. I'm waiting about
> 18 seconds, which I'd like to reduce to 5 seconds to streamline my
> program startup if the postgres server is not available. Did I read the
> documentation incorrectly, or are there any plans to introduce a Timeout
> parameter? I'm using the latest version (08.04.0200).
What kind of tool(e.g. ADO, ADO.NET on Windows) are you using?
regards,
Hiroshi Inoue
> There was a similar unanswered question a while ago:
> http://archives.postgresql.org/pgsql-odbc/2003-06/msg00025.p hp
>
> -Mike
--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
Re: Connection Timeout
am 03.06.2010 16:53:29 von Mike Toews--000e0cdf1872ca23740488215feb
Content-Type: text/plain; charset=ISO-8859-1
On 3 June 2010 02:01, Hiroshi Inoue
>
> 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;P wd=mypw;Timeout=5"
Conn.CommandTimeout = 5
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
--000e0cdf1872ca23740488215feb
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
On 3 June 2010 02:01, Hiroshi Inoue <
:inoue@tpf.co.jp">inoue@tpf.co.jp> wrote:
ail_quote">
der-left:1px #ccc solid;padding-left:1ex;">
What kind of tool(e.g. ADO, AD=
O.NET on Windows) are you using?
regards,
Hiroshi Inoue
SQL Unicode ODBC driver with=A0Python (pyodbc) and VBA (ADO). I get the sam=
e 18 second timeout with both, regardless of what I provide in the connecti=
on string. In VBA, there is a ConnectionTimeout property, but it does not s=
eem to have any influence, e.g.:
x Library
DB.Connection
=A0 =A0ConnStr = "Driver=3D{PostgreSQL Unicode};Server=3D123.4.5.6=
;Port=3D5432;Database=3Dmydb;Uid=3Dmyid;Pwd=3Dmypw;Timeout=3 D5 "
nString =3D ConnStr
..Print "connected"
=A0 =A0Set Conn =3D Nothing
n, since the host is invalid.
ion.timeout property, but it is for query timeout.
--000e0cdf1872ca23740488215feb--
Re: Connection Timeout
am 03.06.2010 17:55:47 von Hiroshi InoueMike Toews wrote:
> On 3 June 2010 02:01, Hiroshi Inoue
>
>
> What kind of tool(e.g. ADO, ADO.NET
> 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;P wd=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
--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
Re: Connection Timeout
am 03.06.2010 19:02:33 von Mike Toews--000e0cd2c5d26172830488232d09
Content-Type: text/plain; charset=ISO-8859-1
On 3 June 2010 08:55, Hiroshi Inoue
>
> Please set the ConnectionTimeout preperty not the CommandTimeout one.
> It seems to work here.
>
>
Ah, of course (they almost look the same). That solution works for VB (ADO).
As for pyodbc, I can make a timeout function (e.g.,
http://nick.vargish.org/clues/python-tricks.html) and I'll probably
ask/request on their list about a connection_timeout property.
Thanks for your help.
-Mike
--000e0cd2c5d26172830488232d09
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
On 3 June 2010 08:55, Hiroshi Inoue <
:inoue@tpf.co.jp">inoue@tpf.co.jp> wrote:
ail_quote">
der-left:1px #ccc solid;padding-left:1ex;">
Please set the ConnectionTimeout preperty not the CommandTimeout one.
It seems to work here.
t solution works for VB (ADO).
n make a timeout function (e.g.,=A0
/python-tricks.html" target=3D"_blank">http://nick.vargish.org/clues/python=
-tricks.html)=A0and I'll probably ask/request on their list about a=
connection_timeout property.
--000e0cd2c5d26172830488232d09--