php.net |  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
Votes:2
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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: shoorf at gmail dot com
New email:
PHP Version: OS:

 

 [2012-07-10 12:02 UTC] shoorf at gmail dot com
Description:
------------
doesn't work setting statement_timeout to postgres and running pg_sleep in 1 
query

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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-06-05 14:08 UTC] mbeccati@php.net
-Status: Open +Status: Not a bug
 [2013-06-05 14:08 UTC] mbeccati@php.net
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: Mon Dec 30 14:01:28 2024 UTC