Fixes #607 PostgreSQL error on 1.8 upgrader