Re: DBD-Pg Placeholder usage in v 1.49

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: DBD-Pg Placeholder usage in v 1.49
Дата
Msg-id 25258.1200503831@sss.pgh.pa.us
обсуждение исходный текст
Ответ на DBD-Pg Placeholder usage in v 1.49  (Max Pyziur <pyz@brama.com>)
Ответы Re: Multiple command usage in DBD-Pg v 1.49
Список pgsql-interfaces
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


В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Max Pyziur
Дата:
Сообщение: DBD-Pg Placeholder usage in v 1.49
Следующее
От: Max Pyziur
Дата:
Сообщение: Re: Multiple command usage in DBD-Pg v 1.49