Chages for new pg_last_notice()

This commit is contained in:
Yasuo Ohgaki 2002-04-06 06:42:02 +00:00
parent b2fce9e893
commit 179a52b025
2 changed files with 13 additions and 3 deletions

View File

@ -141,6 +141,11 @@ typedef struct _php_pgsql_result_handle {
int row; int row;
} pgsql_result_handle; } pgsql_result_handle;
typedef struct _php_pgsql_notice {
char *message;
size_t len;
} php_pgsql_notice;
typedef struct { typedef struct {
long default_link; long default_link;
long num_links,num_persistent; long num_links,num_persistent;
@ -148,9 +153,8 @@ typedef struct {
long allow_persistent; long allow_persistent;
long auto_reset_persistent; long auto_reset_persistent;
int le_lofp,le_string; int le_lofp,le_string;
int ignore_notices; int ignore_notices,log_notices;
char *last_notice; HashTable notices;
uint last_notice_len;
} php_pgsql_globals; } php_pgsql_globals;

View File

@ -1,11 +1,17 @@
<?php <?php
include 'config.inc'; include 'config.inc';
ini_set('pgsql.log_notice',1);
$db = pg_connect($conn_str); $db = pg_connect($conn_str);
pg_query($db, "BEGIN;"); pg_query($db, "BEGIN;");
pg_query($db, "BEGIN;"); pg_query($db, "BEGIN;");
$msg = pg_last_notice($db); $msg = pg_last_notice($db);
if ($msg === FALSE) {
echo "Cannot find notice message in hash\n";
var_dump($msg);
}
echo $msg; echo $msg;
echo "pg_last_notice() is Ok\n"; echo "pg_last_notice() is Ok\n";