native pgsql functions and pear error
| From: | Jeroen Houben | Date: | Wed, 05 Nov 2003 09:22:52 +0000 |
| Subject: | native pgsql functions and pear error | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-8762@lists.php.net to get a copy of this message | ||
Hi,
For one of my projects I'm using postgresql. This code does not need to use a DB abstraction layer as I will not port it to use other databases. Furthermore it makes heavy use of postgresql specific things such as triggers, procedures (in plpgsql) views etc.
So I can just use the native functions you'll say. That is true but I like using PEAR Error, so I was wondering how to go about using the native PG functions in conjuction with PEAR Error. I guess I will need to write a small wrapper class that can throw a PEAR Error after checking the result of query. It can use pgsql_result_error() as the errormessage, but I don't know how to find the error code. The PHP manual doesn't mention anything about that. And without proper error codes PEAR Error is not as useful.
Any ideas?
Jeroen