|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchespgsql_notify_payload.patch (last revision 2011-01-22 18:33 UTC by r dot i dot k at free dot fr)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-01-27 17:02 UTC] iliaa@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: iliaa
[2011-01-27 17:02 UTC] iliaa@php.net
[2011-10-14 06:06 UTC] timosha at gmail dot com
[2011-10-15 16:19 UTC] r dot i dot k at free dot fr
-Status: Closed
+Status: Assigned
-PHP Version: 5.2.17
+PHP Version: 5.3.8
[2011-10-15 16:19 UTC] r dot i dot k at free dot fr
[2012-01-11 08:50 UTC] timosha at gmail dot com
[2012-01-11 09:44 UTC] r dot i dot k at free dot fr
[2012-01-11 09:44 UTC] r dot i dot k at free dot fr
-Status: Assigned
+Status: Closed
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 05:00:01 2025 UTC |
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)