Edit report at https://bugs.php.net/bug.php?id=62522&edit=1

 ID:                 62522
 Updated by:         mbecc...@php.net
 Reported by:        shoorf at gmail dot com
 Summary:            set timeout not affected
-Status:             Open
+Status:             Not a bug
 Type:               Bug
 Package:            PostgreSQL related
 Operating System:   FreeBSD 8.3 amd64
 PHP Version:        5.3.14
 Block user comment: N
 Private report:     N

 New Comment:

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)');


Previous Comments:
------------------------------------------------------------------------
[2012-07-10 12:02:29] 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


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=62522&edit=1

Reply via email to