Skip site navigation (1) Skip section navigation (2)

Re: DBD-Pg Placeholder usage in v 1.49

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Max Pyziur <pyz(at)brama(dot)com>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: DBD-Pg Placeholder usage in v 1.49
Date: 2008-01-16 17:17:11
Message-ID: (view raw or whole thread)
Lists: pgsql-interfaces
Max Pyziur <pyz(at)brama(dot)com> writes:
> FROM prices aa, oi_vol_tmp bb
> WHERE aa.pr_date = bb.pr_date
> AND symbol = ?
> AND aa.pr_date BETWEEN date ? - integer ? AND ?

> I've tried using:
> AND aa.pr_date BETWEEN date ?::date - integer ?::int AND ?::date
> with no success.

It should just be 

... AND aa.pr_date BETWEEN ?::date - ?::int AND ?::date

The type-name-at-the-front syntax is redundant with the cast, and
is only allowed for simple literal constants anyway.  It worked for
you before because DBD-PG was replacing the ? marks with literal
strings, but it wasn't ever really "the right thing".  See

			regards, tom lane

In response to


pgsql-interfaces by date

Next:From: Max PyziurDate: 2008-01-16 17:59:27
Subject: Re: Multiple command usage in DBD-Pg v 1.49
Previous:From: Dean ArnoldDate: 2008-01-16 17:04:00
Subject: Re: DBD::Pg 2.0.0 release candidate available for testing

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group