Subject: | Array ranges aren't placeholders |
Date: | Mon, 04 Feb 2008 16:34:43 +0000 |
To: | bug-dbd-pg [...] rt.cpan.org |
From: | David O'Rourke <david [...] ipec.co.uk> |
Hi,
I'm not sure if this is a bug or not, but I don't seem to be able to get
a decent answer out of Google.
I have a query that works fine in the 'psql' client for selecting a
random range out of an array of a few thousand points. Let's say it's
Show quoted text
> SELECT data[100:300] FROM table WHERE condition = 'foo';
I want to execute this query from Perl using DBD::Pg, I wish to use the
following:
Show quoted text > SELECT data[100:300] FROM table WHERE condition = ?;
Now, at this point I get this error:
Show quoted text > Cannot mix placeholder styles ":foo" and "?" at
/usr/lib/perl5/DBD/Pg.pm line 190.
Now, I really don't understand why. [100:300] is an array range
(http://www.postgresql.org/docs/8.0/interactive/arrays.html), not a
placeholder. Does DBD::Pg need changing to recognise this, or have I
missed some random part of the documentation where there is some way to
properly escape the range so that I can use it?
Thanks.
-David