Fixed stuff for postgresql.