Fix derivation for newer PostgreSQL versions

Apparently, PostgreSQL 9.3 changed how timestamps without timezone work. This fixes the counter_dev computation.