Re: bytea corruption? - Mailing list pgsql-general

From Daniel Verite
Subject Re: bytea corruption?
Date
Msg-id 5e04ee91-21ca-4158-8263-1f48d3e54bd4@mm
Whole thread Raw
In response to Re: bytea corruption?  (Nathan Jahnke <njahnke@gmail.com>)
Responses Re: bytea corruption?
List pgsql-general
    Nathan Jahnke wrote:

> good catch - it's because i'm used to working in plperlu.
> unfortunately commenting out those lines makes no difference for this
> particular data (that i linked in my original email); it's still
> corrupted:

Don't remove both: remove only the custom decoding.

It's different for the encoding step. It can also be removed, but in this
case you need to tell DBD::Pg that your data is binary, like this:

$insert_sth->bind_param(1, $data, { pg_type => DBD::Pg::PG_BYTEA });
$insert_sth->execute();

(and have $data be raw binary, no custom encoding).

--
Daniel
PostgreSQL-powered mail user agent and storage: http://www.manitou-mail.org

pgsql-general by date:

Previous
From: Thomas Kellerer
Date:
Subject: Getting listed on "Community Guide to PostgreSQL GUI Tools"
Next
From: Nathan Jahnke
Date:
Subject: Re: bytea corruption?