Fix errors when using Postgres.