Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Perl and Postgresql: Invalid byte sequence for encoding "UTF8"

by ferreira (Chaplain)
on Dec 22, 2006 at 13:10 UTC ( [id://591315]=note: print w/replies, xml ) Need Help??


in reply to Perl and Postgresql: Invalid byte sequence for encoding "UTF8"

This issue was recently discussed in London-pm mailing list. See the thread here (give special attention to Matt Lawrence's last posts):

http://london.pm.org/pipermail/london.pm/Week-of-Mon-20061127/thread.html#5758

It had to do with some weirdness of the bytea data type and the fine/fast solution was to use:

$sth->bind_param($param_num, $bind_value, { pg_type => DBD::Pg::PG_BYTEA });
where $sth is a DBI statement over a DBD::Pg connection, $param_num is the position of your placeholder in the SQL statement, $bind_value is the content that is making DBD::Pg unhappy. There is more info at the mentioned thread: escaping the data, handling BLOBs in Postgresql, dealing with Class::DBI, etc.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://591315]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2025-05-24 22:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.