Re: plperl and/or insert trigger problem - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: plperl and/or insert trigger problem
Date
Msg-id 20070606163400.GD8997@svana.org
Whole thread Raw
In response to Re: plperl and/or insert trigger problem  (Richard Huxton <dev@archonet.com>)
List pgsql-general
On Wed, Jun 06, 2007 at 04:44:03PM +0100, Richard Huxton wrote:
> I've had a quick look at my copy of DBI.pm (Debian Etch - lives in
> /usr/lib/perl5/DBI.pm)
>
> Around line 1930, we have the error-handling for execute_for_fetch()
>
> else {
>   $err_count++;
>   my $err = $sth->err;
>   push @$tuple_status, [ $err, $errstr_cache{$err} ||= $sth->errstr,
> $sth->state ];

The reference to erstr_cache seems to infer that the code assumes there
can be only one error string for any particular. Looking at the code I
can't work out why that variable even exists.

I'd say replace that line with:

push @$tuple_status, [ $err, $sth->errstr, $sth->state];

And be done with it...

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-general by date:

Previous
From: Erwin Brandstetter
Date:
Subject: Re: Join field values
Next
From: "Woody Woodring"
Date:
Subject: String trim function - possible bug?