Patch suggestion regarding pgsql nextid
| From: | Troels Arvin | Date: | Thu, 02 Aug 2001 19:33:22 +0000 |
| Subject: | Patch suggestion regarding pgsql nextid | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-1257@lists.php.net to get a copy of this message | ||
Hello,
I couldn't get PEAR to work with my Postgresql (v. 7.1.2). Maybe because
Postgresql has changed it's error message when running nextid() on a
non-existing sequence?
Anyways, the patch suggestion is posted below. The patch is for current
CVS.
By the way: I think it's very disturbing that PEAR enforces
that sequences be named "...._seq". - But I'm afraid that this
is too late to change now :-(
/Troels
--- php4/pear/DB/pgsql.php Thu Aug 2 20:39:12 2001
+++ php4-troels/pear/DB/pgsql.php Thu Aug 2 21:20:21 2001
@@ -216,7 +216,7 @@
static $error_regexps;
if (empty($error_regexps)) {
$error_regexps = array(
- '/(Table does not exist\.|Relation \'.*\' does not exist|sequence
does not exist)$/' => DB_ERROR_NOSUCHTABLE,
+ '/(Table does not exist\.|Relation \'.*\' does not exist|sequence
does not exist|class ".+" not found)$/' => DB_ERROR_NOSUCHTABLE,
'/Relation \'.*\' already exists/' =>
DB_ERROR_ALREADY_EXISTS,
'/divide by zero$/' => DB_ERROR_DIVZERO,
'/pg_atoi: error in .*: can\'t parse /' =>
DB_ERROR_INVALID_NUMBER,