David Wheeler wrote:

Now, the driver-development questions: Should DBD::Pg's execute() method
know which bound parameters are binary without being explicitly told via
the attributes to bind_param(), and escape accordingly? Or should DBI
users always explicitly bind binary data using bind_param()'s attributes?

Does it have to? Excuse my ignorance, but is there any reason whatsoever not to do a binary-safe escaping for ordinary strings, and simply using the same quoting method for binary data?

My code is now an ugly mess because I'm force to use bind_param, I'll let you have a peek so you can pity me.

Crist�v�o

if ($self->{_GOTDATA}) {
$h->bind_param (6, $self->{data}, SQL_BINARY)
$h->bind_param (7, $self->{id}, SQL_INTEGER);
} else {
$h->bind_param (6, $self->{id}, SQL_INTEGER);
}

Reply via email to