[email protected] (Mark Stosberg) wrote:

> If you use DBD::Pg and also use PostgreSQL arrays, you should be aware
> there is an open bug with quoting PostgreSQL array values. A bug report
> about the issue is here, including some related test cases and work on
> some patches:

> https://rt.cpan.org/Public/Bug/Display.html?id=58552

> However, the proposed fix is not passing all the test cases. The
> solution will need someone with XS skills, who also has confidence about
> exactly what the correct quoting behavior should be.

> I'm affected by the issue and would personally appreciate the help.

First, I wholeheartedly agree that Noah's patch should fi-
nally be integrated. It's always a pleasure to see when
someone presents a working solution to a real problem, and
very sad if that is then shelved for now over a year :-(.

  But I cannot reproduce your problem with 2.17.1 + Noah's
patch:

| print Dumper $DB->selectall_arrayref ("SELECT s, LENGTH(s) FROM unnest(" . 
$DB->quote (["ab'c"]) . "::TEXT[]) AS s (s);", {});
| print Dumper $DB->selectall_arrayref ("SELECT s, LENGTH(s) FROM 
unnest(?::TEXT[]) AS s (s);", {}, ["ab'c"]);

gives the expected:

| $VAR1 = [
|           [
|             'ab\'c',
|             4
|           ]
|         ];
| $VAR1 = [
|           [
|             'ab\'c',
|             4
|           ]
|         ];

Tim

Reply via email to