Bug #53818 [Com]: Missing info in pg_get_notify function

From: Date: Wed, 11 Jan 2012 08:50:47 +0000
Subject: Bug #53818 [Com]: Missing info in pg_get_notify function
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-166346@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=53818&edit=1

 ID:                 53818
 Comment by:         timosha at gmail dot com
 Reported by:        r dot i dot k at free dot fr
 Summary:            Missing info in pg_get_notify function
 Status:             Assigned
 Type:               Bug
 Package:            PostgreSQL related
 Operating System:   Linux
 PHP Version:        5.3.8
 Assigned To:        iliaa
 Block user comment: N
 Private report:     N

 New Comment:

hmm, seems that this patch applied for php-5.3.9 but no info in changelog


Previous Comments:
------------------------------------------------------------------------
[2011-10-15 16:19:12] r dot i dot k at free dot fr

The provided patch, 9 months ago, is still missing from 5.3 branch...
It would be cool to have it pushed in official source code, since it still works (made for 5.2.17,
applyable to 5.3.8), and give access to a feature appeared in PostgreSQL 14 months ago :(((

------------------------------------------------------------------------
[2011-10-14 06:06:49] timosha at gmail dot com

Please backport this patch to 5.3.x. :)

------------------------------------------------------------------------
[2011-01-27 17:02:36] iliaa@php.net

This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.



------------------------------------------------------------------------
[2011-01-22 19:32:25] r dot i dot k at free dot fr

Description:
------------
Since Postgresql 9.0, event notifications fired by the NOTIFY sql command includes a payload (a 8000
bytes max piece of text).

As of now, the PHP function pg_get_notify only retrieve the "channel" (name of the
notification) and the backend pid.

The attached patch improves this situation by adding the payload to the returned array of the
pg_get_notify function, when the connected PG backend version is at least 9.0.

Hope it helps...

Test script:
---------------
$dbconn = pg_connect(...) ; // To be completed

pg_query($dbconn, "LISTEN toto");
pg_query($dbconn, "NOTIFY toto, 'Hello world !'");

$notify = pg_get_notify($dbconn, PGSQL_ASSOC) ;

print_r($notify) ;


Expected result:
----------------
// Array("message" => "toto", "pid" => 12345,
"payload" => "Hello world !")

Actual result:
--------------
// Array("message" => "toto", "pid" => 12345)


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



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


Thread (6 messages)

« previous php.bugs (#166346) next »