php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #42614 PDO_pgsql: add pg_get_notify support
Submitted: 2007-09-10 17:12 UTC Modified: 2011-01-01 23:21 UTC
Votes:11
Avg. Score:4.9 ± 0.3
Reproduced:11 of 11 (100.0%)
Same Version:4 (36.4%)
Same OS:4 (36.4%)
From: bs@php.net Assigned:
Status: Closed Package: PostgreSQL related
PHP Version: 5.2.4 OS:
Private report: No CVE-ID:
 [2007-09-10 17:12 UTC] bs@php.net
Description:
------------
Hi,
sorry that i post this as a bug, there is no other way to specify a feature request per extension.
Support for PGnotifies() would be great in PDO. ext/pgsql has it already with pg_get_notify().

Docs are at http://www.postgresql.org/docs/8.2/interactive/libpq-notify.html and a sample at http://www.postgresql.org/docs/8.2/interactive/libpq-example.html#LIBPQ-EXAMPLE-2


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-02 08:25 UTC] d dot begley at uws dot edu dot au
Support for PostgreSQL's LISTEN/NOTIFY in PDO has been written since PHP 5.1, it just needs to be integrated with the latest code by one of the core developers - see:

http://netevil.org/blog/2006/oct/background-batch-workflow-processing-with-pdo-pgsql
 [2009-01-30 19:12 UTC] matteo at beccati dot com
Following a post on php-dev and a catch-up with Lukas K. Smith, here's an updated patch for PHP 5.3 HEAD that mimics the behaviour of David/Wez's patch, that unfortunately was lost:

http://www.beccati.com/misc/pdo_pgsql_getnotify_php5_3.patch

The patch adds two methods:

int PDO::pgsqlGetPid()

Returns the PID of the connected backend

mixed PDO::pgsqlGetNotify( [ $result_type = PDO::FETCH_USE_DEFAULT [, [int $ms_timeout = 0 ]])

Returns an array or false, just like pg_get_notify()

$result_type can either be:
  - PDO::FETCH_USE_DEFAULT
  - PDO::FETCH_BOTH
  - PDO::FETCH_NUM
  - PDO::FETCH_ASSOC

$ms_timeout is the timeout in milliseconds that the function will wait before returning if no NOTIFY was received

Thanks go to:
Lukas Kahwe Smith for the support
Wez Fufrlong for the feedback and suggestions
David Begley who is the author of a similar patch
 [2011-01-01 23:21 UTC] jani@php.net
-Summary: (feature request) pg_get_notify in pdo_pgsql +Summary: PDO_pgsql: add pg_get_notify support -Package: Feature/Change Request +Package: PostgreSQL related
 [2013-06-05 00:13 UTC] mbeccati@php.net
Automatic comment on behalf of mbeccati
Revision: http://git.php.net/?p=php-src.git;a=commit;h=b62b8b45286e7e8a69b04fc6aaf28f838c9a5951
Log: Fixed Bug #42614 (PDO_pgsql: add pg_get_notify support)
 [2013-06-05 00:13 UTC] mbeccati@php.net
-Status: Open +Status: Closed
 [2013-11-17 09:30 UTC] laruence@php.net
Automatic comment on behalf of mbeccati
Revision: http://git.php.net/?p=php-src.git;a=commit;h=b62b8b45286e7e8a69b04fc6aaf28f838c9a5951
Log: Fixed Bug #42614 (PDO_pgsql: add pg_get_notify support)
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Tue Feb 21 23:01:36 2017 UTC