Further improvements to the postgres backend: