More fixes for postgres