Skip site navigation (1) Skip section navigation (2)

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: Inconsistent PHP pg_result_error_field PGSQL_DIAG_SOURCE_FUNCTION across instalations
Date: 2010-02-03 13:21:35
Message-ID: 93F94B7AC96B4645A1998F478C5D5DF1@test (view raw or flat)
Thread:
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

pgsql-bugs by date

Next:From: Lothar BongartzDate: 2010-02-03 16:14:28
Subject: BUG #5310: "NOT FOUND" throws "GetData to Procedure return failed." in stored functions
Previous:From: Tom LaneDate: 2010-02-03 06:23:13
Subject: Re: BUG #5304: psql using conninfo fails in connecting to the server

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group