fix casting issue

This commit is contained in:
John Krauss 2016-05-05 14:49:43 -04:00
parent 5dcec6e126
commit 499eb6da62

View File

@ -24,7 +24,7 @@ BEGIN
AND coltable.column_id = col.id
AND coltable.table_id = tab.id
AND col.id = $1
AND CASE WHEN $2 IS NOT NULL THEN timespan = $2 ELSE TRUE END
AND CASE WHEN $2::TEXT IS NOT NULL THEN timespan ILIKE $2::TEXT ELSE TRUE END
ORDER BY timespan DESC LIMIT 1
)
'