fix for PGSQL issue with casting..
will have to switch to pg for developmet also