PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » DB » Bug #4365

Missing Field Reported as Missing Relation (pgsql)

Details

Submitted2005-05-17 14:52 UTC
Fromjam at zoidtechnologies dot com
Assigneddanielc
StatusClosed
PackageDB
PHP Version4.3.11
OSFC1 (Linux)
Roadmaps(Not assigned)

Comments

[2005-05-17 14:52 UTC] jam at zoidtechnologies dot com

Description:
------------
PEAR::DB incorrectly reports a missing column in a relation as a missing table when using the pgsql driver.

Reproduce code:
---------------
May 17 10:45:23 toast httpd: cafeats: reservation: [db_error: message="DB Error: no such table" code=-18 mode=return level=notice prefix="" info="INSERT INTO reservation (productionid,customerid,performanceid,numberoftickets,seatingpreference,seatingtime,comments,confirmed,noshow,cancelled) VALUES ('2','2','1','1','any','6:30pm','',FALSE,FALSE,FALSE) [nativecode=ERROR: column "performanceid" of relation "reservation" does not exist]"]

[2005-05-23 00:41 UTC] jam at zoidtechnologies dot com

corrected typo in summary field.

[2005-05-26 21:42 UTC] jam at zoidtechnologies dot com

--- /home/jam/pgsql.php-original 2005-05-26 16:47:42.000000000 -0400
+++ pgsql.php 2005-05-26 16:55:00.000000000 -0400
@@ -816,4 +816,6 @@
if (!isset($error_regexps)) {
$error_regexps = array(
+ '/column.*of relation.*does not exist/i'
+ => DB_ERROR_NOSUCHFIELD,
'/(relation|sequence|table).*does not exist|class .* not found/i'
=> DB_ERROR_NOSUCHTABLE,

[2005-05-26 21:51 UTC] jam at zoidtechnologies dot com

the above path fixes the issue for me. also note that this error appears when an insert with a missing field is attempted. I have not tested the other operations (select, update).