Re: Passing arrays of strings with backslashes as parameters
[email protected] (Rudy Lippan) Thu, 10 Feb 2011 11:18:27 -0500
| Newsgroups | perl.dbd.pg |
|---|---|
| Message-ID | <[email protected]> |
On 02/07/2011 11:42 AM, Tim Landscheidt wrote: > [email protected] (Rudy Lippan) wrote: > >> an implementation problem in DBD::Pg, but I am not convinced. What does >> a DBI->trace(9) show? >> [...] > > | DBI->trace (9); > | my $DB = DBI->connect ('dbi:Pg:dbname=tim', undef, undef, { pg_enable_utf8 => 1, PrintError => 0 }) or die (DBI->errstr ()); > | my $TestOutput = $DB->selectcol_arrayref ('SELECT LENGTH(unnest(?::TEXT[]));', {}, ['abc', 'def', 'g\hi']) or die ($DB->errstr ()); > | $DB->disconnect () or die ($DB->errstr ()); > | print Dumper $TestOutput; > > gives about 300 lines of output: > [...] > | Begin dbd_bind_ph (ph_name: 1) > | Begin pg_stringify_array > | End pg_stringify_array (string: '{"abc","def","g\\\\hi"}') My first impresison is that pg_stringify_array is giving you your extra backslash. I don't have time to dig much into it right now. Maybe someone who knows that bit of code could tell you what the problem is.... > | Bind (1) (type=0) > | End dbd_bind_ph (special) > | Begin dbd_st_execute > | PQexecPrepared item #0 > | -> Value: ({"abc","def","g\\\\hi"}) -r