[Dbix-class] Bind parameters in select list and group by on Pg

dorian taylor dorian.taylor.lists at gmail.com
Fri Oct 28 13:22:05 GMT 2011


On Fri, Oct 28, 2011 at 5:49 AM, Will Crawford
<billcrawford1970 at gmail.com> wrote:

> I think it's "interval" "6" "month(s?)" which would translate to
> "interval ? ?" ... but the months/ whatever is a keyword not a string,
> and I don't think you can use placeholders for that. So you'd want
> "interval ? month" maybe?

Nah, it's passed in as a string, which is why the syntax error is baffling:

http://www.postgresql.org/docs/9.0/interactive/datatype-datetime.html#DATATYPE-INTERVAL-INPUT

Actually, you're right. Sort of. It takes both. Could have sworn I
tried that though.

INTERVAL '1' MONTH would be equivalent to INTERVAL '1 month'. The
MONTH keyword is supposed to constrain what's a valid interval string,
but it's also supposed to be optional. Hooray for syntax ambiguity!

I guess I'll give it a shot once my system finishes upgrading (hey,
never know. Pg 9.1 might just magically make all this go away).

-- 
Dorian Taylor
http://doriantaylor.com/



More information about the DBIx-Class mailing list