php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9273 feature request: pg_cancel()
Submitted: 2001-02-15 06:12 UTC Modified: 2002-01-07 06:32 UTC
From: hamann dot w at t-online dot de Assigned: yohgaki (profile)
Status: Closed Package: PostgreSQL related
PHP Version: 4.0.4pl1 OS: Linux
Private report: No CVE-ID: None
 [2001-02-15 06:12 UTC] hamann dot w at t-online dot de
Feature request: add pg_cancel() function

Background: although a database search script tries to
avoid "unwanted" queries, sometimes users manage to
do searches that will take considerable time, then press STOP
in their browser. With postgresql this means that the requesting
cgi process is stopped, but the actual database process
continues to run. If this happens a few times (same user requesting
slightly different data), there will be a couple of useless
processes hogging the database server.
Obvious solution (tested on tcl based cgi script) is to
use pg_cancel(), probably with a register_shutdown_function

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-03-07 08:49 UTC] sasha@php.net
Good point, but the implementation is not so
straightforward. Note that the registered shutdown function
is called the next time your script tries to output some
data. By that time the blocking pg_exec function will return
and that means that your backend process have terminated.
Actually we need not only the pg_cancel function, but
support for asynchronous query processing... I will see how
such a bunch of functions can be implemented.
 [2001-12-05 18:39 UTC] yohgaki@php.net
Assigned to myself. (Patch is there, but it need to discuss design is good enough or not) Sasha, if you have been done some coding? Could you send me a patch?

 [2001-12-05 19:10 UTC] yohgaki@php.net
Status => Assigned
 [2002-01-07 06:32 UTC] yohgaki@php.net
Implemented in 4.2.0-dev
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 07:01:32 2024 UTC