Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 1E2F12E2FE6 for ; Wed, 16 Jan 2008 13:17:22 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 03355-01 for ; Wed, 16 Jan 2008 13:17:17 -0400 (AST) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id B33E42E2EFF for ; Wed, 16 Jan 2008 13:17:16 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id m0GHHBOn025259; Wed, 16 Jan 2008 12:17:11 -0500 (EST) To: Max Pyziur cc: pgsql-interfaces@postgresql.org Subject: Re: DBD-Pg Placeholder usage in v 1.49 In-reply-to: References: Comments: In-reply-to Max Pyziur message dated "Wed, 16 Jan 2008 11:16:41 -0500" Date: Wed, 16 Jan 2008 12:17:11 -0500 Message-ID: <25258.1200503831@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/12 X-Sequence-Number: 6690 Max Pyziur 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 http://www.postgresql.org/docs/8.2/static/sql-syntax-lexical.html#SQL-SYNTAX-CONSTANTS-GENERIC regards, tom lane