I’m trying to evaluate whether I can use servoy with an existing postgresql database. The database uses the interval datatype which, in an SQL statement, can look like this:
"1 hour"::interval
Servoy doesn’t seem to like that, because I’m getting errors saying that PostgreSQL is getting a varchar instead of an interval.
Can anyone point me to a way that I may rewrite the SQL for this field as it gets fed into the insert/update statement, or perhaps a more elegant approach?
Hi Travis,
PostgreSQL intervals are nice, much easier to understand than date manipulating dates in Javascript 
Some untested ideas:
You can write a simple pgsql functions to set the interval. Servoy passes a varchar, and you set the field as an interval; in Servoy 3.5 you can add a query to manually set the interval when Servoy saves the record.
You may be able to combine this with a virtual field in Servoy, see
http://forum.servoy.com/viewtopic.php?t=9258
or
if you can modify the database table, add a varchar or text field to hold a text representation of the field, then you add a trigger on CREATE AND UPDATE which sets the interval field…
Hope this helps,