On Tue, Sep 30, 2003 at 06:24:27PM +0100, Tim Bunce wrote:
> On Tue, Sep 30, 2003 at 08:57:35AM -0400, Hardy Merrill wrote:
> > 
> > My thought was that we'd
> > somehow want to know specifically that the violation is caused
> > by an attempt to insert a duplicate key, but 23000 is a
> > "generic" constraint violation error.  Is a generic constraint
> > violation error what we want for this?
> 
> It's all the standard gives you.
> 
> If you need more details there's always $h->errstr ...

I like the idea of having standard error values to check for, but if we
have to fall back to $dbh->errstr() anyway, I'm not sure what we're gaining
from this.  Personally, I've written a lot of code that checks for unique
constraint violations.  Detecting a generic constraint violation, without
knowing what type of constraint was violated, just doesn't seem very
useful to me.

Ronald

Reply via email to