Fixes for PostGIS backend on the setup script

See both commit messages for details.