Home » Database » DB » Bug #446
errorCode($errormsg) is not working correctly for postgresql 7.4 (PATCH)
Details
| Submitted | 2003-12-17 19:12 UTC |
|---|---|
| From | eike at unorganized dot net |
| Assigned | lsmith |
| Status | Closed |
| Package | DB |
| PHP Version | 4.3.3 |
| OS | Irrelevant |
| Roadmaps | (Not assigned) |
Comments
[2003-12-17 19:12 UTC] eike at unorganized dot net
Description:
------------
One of my php scripts uses nextId(), and after changeing from a mysql db to a postgresql 7.4 db, those nextId() calls stopped working, always returning '1'.
While looking into this, I found the error in function errorCode($errormsg): the "relation 'foobar' does not exist" error was not mapped to DB_ERROR_NOSUCHTABLE.
postgresql 7.4 seems to have changed the error message when querying a nonexisting sequence:
- Relation 'foobar' does not exist
+ relation 'foobar' does not exist
The easiest fix is to make the checks in errorCode() case-insensitive: <a href="http://bastard.pmnet.uni-oldenburg.de/pgsql.php.errorCode.caseinsensitive.txt">http://bastard.pmnet.uni-oldenburg.de/pgsql.php.errorCode.caseinsensitive.txt</a>
After applying that, my nextId() calls work again.
Thanks,
Eike