xref: /PHP-5.5/ext/pgsql/tests/09notice.phpt (revision c0d99fd7)
1--TEST--
2PostgreSQL notice function
3--SKIPIF--
4<?php
5
6include("skipif.inc");
7
8_skip_lc_messages();
9
10?>
11--INI--
12pgsql.log_notice=1
13pgsql.ignore_notice=0
14--FILE--
15<?php
16include 'config.inc';
17include 'lcmess.inc';
18
19$db = pg_connect($conn_str);
20
21_set_lc_messages();
22
23$res = pg_query($db, 'SET client_min_messages TO NOTICE;');
24var_dump($res);
25
26pg_query($db, "BEGIN;");
27pg_query($db, "BEGIN;");
28
29$msg = pg_last_notice($db);
30if ($msg === FALSE) {
31	echo "Cannot find notice message in hash\n";
32	var_dump($msg);
33}
34echo $msg."\n";
35echo "pg_last_notice() is Ok\n";
36
37?>
38--EXPECTF--
39resource(%d) of type (pgsql result)
40
41Notice: pg_query(): %s already a transaction in progress in %s on line %d
42%s already a transaction in progress
43pg_last_notice() is Ok
44