summaryrefslogtreecommitdiff
path: root/ext/pgsql
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2011-01-27 16:02:30 +0000
committerIlia Alshanetsky <iliaa@php.net>2011-01-27 16:02:30 +0000
commit46ff954ca74f7aee80242d6f2e5efce6ca341a46 (patch)
tree422172153397f84cfae38663c2a0e35fd71377c6 /ext/pgsql
parentc10b7e3ac2825d6bb41a47290a4118212dc7b1db (diff)
downloadphp-git-46ff954ca74f7aee80242d6f2e5efce6ca341a46.tar.gz
Added support for "extra" parameter for PGNotify().
Diffstat (limited to 'ext/pgsql')
-rw-r--r--ext/pgsql/pgsql.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 0ae111646c..d321ec4883 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -4782,10 +4782,24 @@ PHP_FUNCTION(pg_get_notify)
if (result_type & PGSQL_NUM) {
add_index_string(return_value, 0, pgsql_notify->relname, 1);
add_index_long(return_value, 1, pgsql_notify->be_pid);
+#if HAVE_PQPROTOCOLVERSION && HAVE_PQPARAMETERSTATUS
+ if (PQprotocolVersion(pgsql) >= 3 && atof(PQparameterStatus(pgsql, "server_version")) >= 9.0) {
+#else
+ if (atof(PG_VERSION) >= 9.0) {
+#endif
+ add_index_string(return_value, 2, pgsql_notify->extra, 1);
+ }
}
if (result_type & PGSQL_ASSOC) {
add_assoc_string(return_value, "message", pgsql_notify->relname, 1);
add_assoc_long(return_value, "pid", pgsql_notify->be_pid);
+#if HAVE_PQPROTOCOLVERSION && HAVE_PQPARAMETERSTATUS
+ if (PQprotocolVersion(pgsql) >= 3 && atof(PQparameterStatus(pgsql, "server_version")) >= 9.0) {
+#else
+ if (atof(PG_VERSION) >= 9.0) {
+#endif
+ add_assoc_string(return_value, "payload", pgsql_notify->extra, 1);
+ }
}
PQfreemem(pgsql_notify);
}