pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Max Pyziur <pyz@brama.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: DBD-Pg Placeholder usage in v 1.49
Date: Wed, 16 Jan 2008 12:17:11 -0500
Message-ID: <25258.1200503831@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.60.0801161114120.12755@brama.com>
References: <Pine.LNX.4.60.0801161114120.12755@brama.com>

Max Pyziur <pyz@brama.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

http://www.postgresql.org/docs/8.2/static/sql-syntax-lexical.html#SQL-SYNTAX-CONSTANTS-GENERIC

			regards, tom lane



view thread (2+ messages)

Message-ID: <25258.1200503831@sss.pgh.pa.us>
Permalink:  ../25258.1200503831@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/25258.1200503831@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pyz@brama.com
  Subject: Re: DBD-Pg Placeholder usage in v 1.49
  In-Reply-To: <25258.1200503831@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox