21pg_get_notify.phpt 377 B

12345678910111213141516171819202122
  1. --TEST--
  2. PostgreSQL pg_get_notify() functions
  3. --EXTENSIONS--
  4. pgsql
  5. --SKIPIF--
  6. <?php include("skipif.inc"); ?>
  7. --FILE--
  8. <?php
  9. // optional functions
  10. include('config.inc');
  11. $db = pg_connect($conn_str);
  12. pg_query($db, 'LISTEN test_msg');
  13. pg_query($db, 'NOTIFY test_msg');
  14. $msg = pg_get_notify($db);
  15. isset($msg['message'],$msg['pid']) ? print 'OK' : print 'NG';
  16. ?>
  17. --EXPECT--
  18. OK