Re: Passing varchar parameter to INTERVAL

Поиск
Список
Период
Сортировка
От hubert depesz lubaczewski
Тема Re: Passing varchar parameter to INTERVAL
Дата
Msg-id 20160907133502.fnaymlwquc2jw4gx@depesz.com
обсуждение исходный текст
Ответ на Passing varchar parameter to INTERVAL  (Alexander Farber <alexander.farber@gmail.com>)
Список pgsql-general
On Wed, Sep 07, 2016 at 03:05:38PM +0200, Alexander Farber wrote:
> ERROR:  syntax error at or near "in_until"
> LINE 69: ...       banned_until = CURRENT_TIMESTAMP + INTERVAL in_until,
>                                                                ^
> Is there please a better way here?

Why don't you simply make in_util parameter interval? What is the point
of accepting varchar, if you're unconditionally casting it to interval
anyway?

Having said that, the error looks rather strange for this.

depesz

--
The best thing about modern society is how easy it is to avoid contact with it.
                                                             http://depesz.com/


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

Предыдущее
От: rob stone
Дата:
Сообщение: Re: Passing varchar parameter to INTERVAL
Следующее
От: Alexander Farber
Дата:
Сообщение: Re: Passing varchar parameter to INTERVAL