Inconsistent PHP pg_result_error_field PGSQL_DIAG_SOURCE_FUNCTION across instalations

Lists: pgsql-bugs
From: "IP" <ireneusz(dot)pastusiak(at)poczta(dot)fm>
To: <pgsql-bugs(at)postgresql(dot)org>
Subject: Inconsistent PHP pg_result_error_field PGSQL_DIAG_SOURCE_FUNCTION across instalations
Date: 2010-02-03 13:21:35
Message-ID: 93F94B7AC96B4645A1998F478C5D5DF1@test
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

PHP Script:

<?php

if($c = pg_connect("host=192.168.0.10 dbname=xxx user=xxx password=xxx port=5432")) {

echo "Successfully connected to PostgreSQL 8.4.2 by Enterprise DB @ Windows Vista x86<br>";

$s = "DROP TABLE t123;"; // table doesn't exist

pg_send_query($c, $s);

$r = pg_get_result($c);

echo "Source function: " . pg_result_error_field($r, PGSQL_DIAG_SOURCE_FUNCTION) . "<br><br>";

pg_close($c);

}

if($c = pg_connect("host=192.168.0.60 dbname=xxx user=xxx password=xxx port=5432")) {

echo "Successfully connected to PostgreSQL 8.4.2 (installed from package) @ Sun Solaris 10 x86<br>";

$s = "DROP TABLE t123;"; // table doesn't exist

pg_send_query($c, $s);

$r = pg_get_result($c);

echo "Source function: " . pg_result_error_field($r, PGSQL_DIAG_SOURCE_FUNCTION) . "<br><br>";

pg_close($c);

}

if($c = pg_connect("host=192.168.0.60 dbname=xxx user=xxx password=xxx port=5431")) {

echo "Successfully connected to PostgreSQL 8.5alpha3 (installed from source) @ Sun Solaris 10 x86<br>";

$s = "DROP TABLE t123;"; // table doesn't exist

pg_send_query($c, $s);

$r = pg_get_result($c);

echo "Source function: " . pg_result_error_field($r, PGSQL_DIAG_SOURCE_FUNCTION) . "<br><br>";

pg_close($c);

}

?>

###############################################

Output:

Successfully connected to PostgreSQL 8.4.2 by Enterprise DB @ Windows Vista x86
Source function: DropErrorMsgNonExistent

Successfully connected to PostgreSQL 8.4.2 (installed from package) @ Sun Solaris 10 x86
Source function:

Successfully connected to PostgreSQL 8.5alpha3 (installed from source) @ Sun Solaris 10 x86
Source function: DropErrorMsgNonExistent

###############################################
Issue: no value returned for 8.4.2 Solaris 10 x86 installation