Fix Realtime to work with MySQL and Postgres both (bug #3029)