Fix some PgSQL schema issues