Proper postgresql upgrade script.