We help IT Professionals succeed at work.
Get Started

Detecting postgresql timeout in php script

marcprog asked
Last Modified: 2012-05-10
I have some php scripts that make sql requests to a postgresql database. Some of the queries are timing out (despite increasing the efficiency of the query) but the script stalls since it's not getting any response it recognizes.  Is there a way to get these php scripts to recognize when the database times out?

Currently, for the user in postgresql, the session_timeout variable is set to 30 seconds (however this could change anytime).  pgAdmin III is able to detect when the timeout occurs but I can't find anything in the docs about how.

Watch Question
Most Valuable Expert 2011
Author of the Year 2014
This problem has been solved!
Unlock 1 Answer and 7 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE