xref: /PHP-5.3/ext/pgsql/tests/09notice.phpt (revision 18b8a3bc)
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_notices=0
14--FILE--
15<?php
16include 'config.inc';
17include 'lcmess.inc';
18
19$db = pg_connect($conn_str);
20
21_set_lc_messages();
22
23pg_query($db, "BEGIN;");
24pg_query($db, "BEGIN;");
25
26$msg = pg_last_notice($db);
27if ($msg === FALSE) {
28	echo "Cannot find notice message in hash\n";
29	var_dump($msg);
30}
31echo $msg."\n";
32echo "pg_last_notice() is Ok\n";
33
34?>
35--EXPECTF--
36Notice: pg_query(): %s already a transaction in progress in %s on line %d
37%s already a transaction in progress
38pg_last_notice() is Ok
39