On Tue, 9 Sep 2003, Zhivko Duchev wrote:

> Hello all,
> I'm trying to load a large amount of binary data in bytea field in Postgre 
> table using perl.
> The problem is that the only way I've managed to do it was by using 
> placeholders and binding like this:
>   $statement="Insert into pic1 (pic,type) values(?,'eps2')";
>   $sth=$dbh->prepare($statement);
>   $sth->bind_param(1, "$md",SQL_QUERY ) || die $dbh->errstr;
> 
> Is there any "generic" way to write this statement in the "usual" way :
> INSERT INTO table (col1,col2,...) VALUES (val1,val2,...).

Placeholders are the standard way of inserting data into a database.

> 
> I'm using Perl5.6.1 ;DBI 1.21 ;DBD:Pg 1.01; PostgreSQL 7.2.1 on Debian Linux 
> mashine
> 

Your DBD::Pg is quite old and has some possible bufer overruns in quoting
of bytea data, so you might want to upgrade.


Rudy

Reply via email to