DBD::Pg - BYTEA - fails for range outside chr(0)-chr(127) - Mailing list pgsql-general

From merlyn@stonehenge.com (Randal L. Schwartz)
Subject DBD::Pg - BYTEA - fails for range outside chr(0)-chr(127)
Date
Msg-id m1lmmdq5vc.fsf@halfdome.holdit.com
Whole thread Raw
Responses Re: DBD::Pg - BYTEA - fails for range outside chr(0)-chr(127)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
[Note, I'm not a member of this list (yet :), so cc me on any responses.
I posted this to the Perl-dbi list and they suggest I take it here.]

I'm getting core dumps when I try to use a BYTEA value with
a byte outside 0..127.

    use DBI qw(SQL_BINARY);
    my $dbh = DBI->connect("dbi:Pg:dbname=merlyntest", "user", "pass",
      { RaiseError => 1 });
    $dbh->do("CREATE TABLE test (a BYTEA)");
    my $insert = $dbh->prepare("INSERT INTO test VALUES (?)");
    $insert->bind_param(1, undef, SQL_BINARY); # necessary for BYTEA escaping
    $insert->execute("fred"); # works fine
    $insert->execute(pack "C*", 0..127); # works fine
    $insert->execute(pack "C*", 128); # BOMB, core dump

(I'm cutting and pasting this from a perl debugger session, so if
that's not quite it, forgive me.)

DBI version 1.18
DBD::Pg version 1.00
postgresql version 7.1.2
Perl version 5.5.3

Is it just me?  Am I not holding my mouth right?

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

pgsql-general by date:

Previous
From: "Jeffrey Silberberg"
Date:
Subject: Relationship Issue PGSQL --> Access/97
Next
From: Philip Molter
Date:
Subject: Re: Weird error