Update to work with postgresql.