On Tuesday, October 22, 2002, at 03:43 PM, Crist�v�o Dalla Costa wrote:
Okay, the problem is that DBD::Pg's execute() method doesn't call quote() for the parameters passed to it. So quote() is never called for your code. The good news is that you don't have to base64 encode your binary data. Instead, call the quote() method yourself:Can you send me the script and the data you're trying to insert?My pleasure.
while (my $rd = read $fh, $data2, 65536) {
$data .= $dbh->quote($data2);
$datasize += $rd;
}
Then the data will be properly escaped and insertable into a bytea field.
However, this is a workaround. The DBI documentation says of the quote() method, "There is no need to quote values being used with "Placeholders and Bind Values". However, Crist�v�o used Placeholders and got the error. Should DBD::Pg be calling quote() from its execute method? I looked around a bit at the DBD::Pg code, but the XS is a little over my head. Anyone want to provide a patch?
Thanks,
David
--
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 15726394
http://david.wheeler.net/ Yahoo!: dew7e
Jabber: [EMAIL PROTECTED]
