|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62522 set timeout not affected
Submitted: 2012-07-10 12:02 UTC Modified: 2013-06-05 14:08 UTC
Avg. Score:4.5 ± 0.5
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: shoorf at gmail dot com Assigned:
Status: Not a bug Package: PostgreSQL related
PHP Version: 5.3.14 OS: FreeBSD 8.3 amd64
Private report: No CVE-ID: None
 [2012-07-10 12:02 UTC] shoorf at gmail dot com
doesn't work setting statement_timeout to postgres and running pg_sleep in 1 

but it sql query works fine when it runs through psql in console
if run 3 separated queries (SET, pg_sleep, RESET), it works fine too

Test script:
pg_query($db, 'SET statement_timeout TO 0; SELECT pg_sleep(180); RESET statement_timeout;');

Expected result:
not timeout

Actual result:
if statement_timeout in postgres settings set less than 180 sec, this code give 
the error: canceling statement due to statement timeout


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-06-05 14:08 UTC]
-Status: Open +Status: Not a bug
 [2013-06-05 14:08 UTC]
This looks like a limitation of the libpq's PQExec function. If really necessary, you could use:

pg_query($pg, 'BEGIN; SET statement_timeout TO 1; COMMIT; SELECT pg_sleep(3)');
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 19 14:01:32 2024 UTC