BUG #5318: Inconsistent PHP pg_result_error_field PGSQL_DIAG_SOURCE_FUNCTION across instalations

From: "IP" <ireneusz(dot)pastusiak(at)poczta(dot)fm>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #5318: Inconsistent PHP pg_result_error_field PGSQL_DIAG_SOURCE_FUNCTION across instalations
Date: 2010-02-06 14:59:48
Message-ID: 201002061459.o16ExmPO075483@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 5318
Logged by: IP
Email address: ireneusz(dot)pastusiak(at)poczta(dot)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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2010-02-06 15:57:23 Re: BUG #5318: Inconsistent PHP pg_result_error_field PGSQL_DIAG_SOURCE_FUNCTION across instalations
Previous Message The Fuzzy Chef 2010-02-06 02:50:32 Possible stability issue: permanent hang on dropdb