Finish migrating to postgresql