On Thu, 24 Oct 2002, David Wheeler wrote:
> > Whoops, my bad. Indeed the first method increases the file size by a 
> > couple bytes, guess I wasn't paying enough attention.
> 
> Not sure how that happens, but I'd be happy to see quote() replaced 
> with calls to the appropriate libpq routines.
> 


Because the loop looked something like:

for (qw(this is a test)) {
     $data .= $dbi->quote($_);
}

so you would end up with: 'this''is''a''test', and since '' is just an 
escaped qoute, q{this'is'a'test} gets inserted into the db.


Note, however,  that: 

for (qw(this is a test)) {
    $data .= $dbi->quote($_)."\n";
}

Would probably do what you were expecting.

-r

Reply via email to