BUG #5318: Inconsistent PHP pg_result_error_field PGSQL_DIAG_SOURCE_FUNCTION across instalations - Mailing list pgsql-bugs

From IP
Subject BUG #5318: Inconsistent PHP pg_result_error_field PGSQL_DIAG_SOURCE_FUNCTION across instalations
Date
Msg-id 201002061459.o16ExmPO075483@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #5318: Inconsistent PHP pg_result_error_field PGSQL_DIAG_SOURCE_FUNCTION across instalations  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged online:

Bug reference:      5318
Logged by:          IP
Email address:      ireneusz.pastusiak@poczta.fm
PostgreSQL version: 8.4.2
Operating system:   Sun Solaris 10 x86
Description:        Inconsistent PHP pg_result_error_field
PGSQL_DIAG_SOURCE_FUNCTION across instalations
Details:

I have already posted this issue to pgsql-bugs list, but in incorrect
version: http://archives.postgresql.org/pgsql-bugs/2010-02/msg00034.php

Now posting it via Bug Reporting form. I believe this is not PHP, but DB
engine issue, as specified below.

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

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: BUG #5315: Unlisted keyword WINDOW
Next
From: Tom Lane
Date:
Subject: Re: BUG #5318: Inconsistent PHP pg_result_error_field PGSQL_DIAG_SOURCE_FUNCTION across instalations