+static int apply_unlisten(void *p TSRMLS_DC, int argc, va_list argv, zend_hash_key *key)
+{
+ php_pqconn_object_t *obj = va_arg(argv, php_pqconn_object_t *);
+ char *quoted_channel = PQescapeIdentifier(obj->intern->conn, key->arKey, key->nKeyLength - 1);
+
+ if (quoted_channel) {
+ PGresult *res;
+ char *cmd;
+
+ spprintf(&cmd, 0, "UNLISTEN %s", quoted_channel);
+ if ((res = PQexec(obj->intern->conn, cmd))) {
+ PHP_PQclear(res);
+ }
+
+ efree(cmd);
+ PQfreemem(quoted_channel);
+ }
+
+ return ZEND_HASH_APPLY_REMOVE;
+}
+
+static void php_pqconn_notice_ignore(void *p, const PGresult *res)
+{
+}
+