[NUCRDBMS-820] Add cast to getSecond for PostgreSQL