[gdal-dev] postgis: strange behavior when 'public' schema does not exist

Martijn van Exel m at rtijn.org
Thu Apr 12 01:13:23 EDT 2012

Hi all,

I had trouble extracting a shape file from a PostGIS table using ogr2ogr
(1.9.0 on Ubuntu 10.04 64 bit). Debug output from ogr2ogr:

mvexel at lima:/osm/tmp/candidates$ ogr2ogr -overwrite -f "ESRI Shapefile"
--debug on candidates PG:"dbname=osmus active_schema=us user=osm
password=osm" candidates
PG: DBName="osmus"
ERROR 1: ERROR:  invalid value for parameter "search_path": "us, public"
DETAIL:  schema "public" does not exist

Unable to open datasource `PG:dbname=osmus active_schema=us user=osm
password=osm' with the following drivers.

What I think happens is that ogr implies that schema public exists (which
is not a requirement for PostgreSQL) and appends that to the schemas list
to feed to search_path. SET search_path then fails, and the active_schema
is not set. Consequently, the table is not found and ogr2ogr is not able to

Adding a 'public' schema to the database remedied the situation.

Is this a bug? Do you need more information?

martijn van exel
geospatial omnivore
1109 1st ave #2
salt lake city, ut 84103
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120411/15cf2b09/attachment.html

More information about the gdal-dev mailing list