finish converting to postgres