Re: Sequences in DB/pgsql (once again)
| From: | Stig S. Bakken | Date: | Fri, 15 Dec 2000 00:30:21 +0000 |
| Subject: | Re: Sequences in DB/pgsql (once again) | ||
| References: | 1 2 3 | Groups: | php.pear |
| Request: | Send a blank email to php-pear+get-694@lists.php.net to get a copy of this message | ||
Rui Hirokawa wrote:
>
> > I'm thinking of addressing postgres error mapping (so we can use DB's
> > DB_ERROR_BLAH error codes for things like these) by regular expression
> > matching on pg_errormessage() output. There are really no other ways to
> > do it as far as I can see. Again, the implementation will be supported
> > by regression tests so we can verify that it works in different postgres
> > versions.
>
> I think the regular expression matching is not efficient,
> but there is no other ways as you said.
>
> I think adding a function returning error code to libpq is better way.
Modifying PHP's Postgres extension won't do, because libpq does not
offer error codes. Modifying libpq won't do either, because we still
have to support the "string only" behaviour for those who don't have the
modified libpq. Maybe we can get away with just defining an associative
array? I'll give it a shot.
- Stig