setting connection/ query timeout

From: "tamanna madaan" <tamanna(dot)madan(at)globallogic(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: setting connection/ query timeout
Date: 2011-04-19 19:09:43
Message-ID: 68666423656E1444A011106C4E085F4D96F302@ex3-del1.synapse.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi All

I am using postgres-8.1.2 . In postgresql.conf I have set :

#statement_timeout = 0

I am executing the below query just to check if postgres is allowing connections or not .

psql -Uslon -d<db_name> -h <IP> -c "select 1;"

Sometimes this query gets stuck for unknown reason . So, for this particular query I want to set a timeout
. I dont want to change "statement_timeout" in postgresql.conf as this would affect all the connections/queries.
I just want to set timeout for above mentioned query . How can I do that ??

Moreover, Just in case there is some problem while getting connection to postgres while executing the above query ,
I want the query to exit . How can I set connection timeout for that ??

Thanks..
Tamanna

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Gould 2011-04-19 19:22:20 Re: "Service user account 'postgres' could not be created" -- 8.4.2-1 and Active Directory on Windows08 R2
Previous Message Greg Corradini 2011-04-19 18:48:47 "Service user account 'postgres' could not be created" -- 8.4.2-1 and Active Directory on Windows08 R2