Re: Sequences in DB/pgsql (once again)

From: Date: Fri, 15 Dec 2000 10:29:08 +0000
Subject: Re: Sequences in DB/pgsql (once again)
References: 1 2 3 4 5  Groups: php.pear 
Request: Send a blank email to php-pear+get-697@lists.php.net to get a copy of this message
Mikhail Zabaluev wrote: > > Hello Stig, > > On Fri, Dec 15, 2000 at 01:30 +0100, Stig S. Bakken wrote: > > > > 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. > > I don't know, but the exact messages might not be persistent across > Postgres versions - be it in the past or in the future. That's true, but this is exactly what we have testing for. Once we are pretty confident that it works for current and older versions, it's not a problem to deal with new versions as they are released. I really don't see any other ways of doing this. - Stig

« previous php.pear (#697) next »