my $sth = $dbh->prepare("INSERT INTO foo (blob) VALUES (?)"); $sth->bind_param(1, $blob_data, { pg_type => DBD::Pg::PG_BYTEA });