Qgis 1.0 Preview 2 Postgres fix

I fixed a problem in Qgis where all PostGIS layers would be seen as invalid.