Re: Passing varchar parameter to INTERVAL - Mailing list pgsql-general

From hubert depesz lubaczewski
Subject Re: Passing varchar parameter to INTERVAL
Date
Msg-id 20160907133502.fnaymlwquc2jw4gx@depesz.com
Whole thread Raw
In response to Passing varchar parameter to INTERVAL  (Alexander Farber <alexander.farber@gmail.com>)
List 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 by date:

Previous
From: rob stone
Date:
Subject: Re: Passing varchar parameter to INTERVAL
Next
From: Alexander Farber
Date:
Subject: Re: Passing varchar parameter to INTERVAL