Thread: How to change PQexec timeout?

How to change PQexec timeout?

From
Sergey Belikov
Date:
Dear postgreSQL experts,
could you explain me how can I dynamically change  time-out value for
each PQexec() call? Or at least how can I set time-out for my current
program?
I found
void setQueryTimeout (int seconds)
in libodbc++ documentation, but nothing of this kind in libpq. Should I
install libodbc++ to manipulate time-out value, or there is something in
postgreSQL itself?
Thank you, Sergey.

--
Sergey V Belikov            home phone:   (631)924-0458
Bldg. 510C                  office phone: (631)344-5682
Upton, NY 11973             fax:          (631)344-3253




Re: How to change PQexec timeout?

From
Bruce Momjian
Date:
Sergey Belikov wrote:
> Dear postgreSQL experts,
> could you explain me how can I dynamically change  time-out value for
> each PQexec() call? Or at least how can I set time-out for my current
> program?
> I found
> void setQueryTimeout (int seconds)
> in libodbc++ documentation, but nothing of this kind in libpq. Should I
> install libodbc++ to manipulate time-out value, or there is something in
> postgreSQL itself?

Sure use 'SET statement_timeout = 30' for 30 milliseconds.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073