Re: [PHP4BETA] cvs: /php4/pear DB.php /php4/pear/DB common.php mysql.php pgsql.php storage.php
| From: | Jouni Ahto | Date: | Fri, 18 Feb 2000 06:45:05 +0000 |
| Subject: | Re: [PHP4BETA] cvs: /php4/pear DB.php /php4/pear/DB common.php mysql.php pgsql.php storage.php | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-10432@lists.php.net to get a copy of this message | ||
On Fri, 18 Feb 2000, Rui Hirokawa wrote:
> ssb> +//
> ssb> +// 2. The pgsql extension currently does not have error codes. This
> ssb> +// should be fixed so DB_pgsql can do portable error codes.
> ssb> +//
> ssb>
>
> The current implementation of DB_pgsql can't handle error codes because
> the current pgsql extention does not support any error codes.
Maybe because there is no such function that would return an error code in
PostgreSQL's C api, only one that returns an error message. At least the
Sybase extension too seems to lack error codes, whether the reason is the
same I don't know.
So, I guess the DB extension and upcoming DB_* modules should somehow cope
with the fact that there possibly aren't any error codes... :( Can't think
a way of how. Parsing the error messages could/would be quite heavyweight,
and anyway, they have a tendency to slightly change in different versions.
Time to file a feature request to some of the PostgreSQL mailing lists.
> But the API change in error codes of the pgsql extention may causes some
> imcompatibility problem with the old codes which depend on the current
> error codes.
> I think the new function handling the error codes
> should be added to maintain the compatibility.
Well, maybe the day PostgreSQL gets error codes.
-- Jouni Ahto