[gdal-dev] ogr2ogr and PostGIS 2.0

EdH ed.hudspeth at nnpa.org.uk
Wed Mar 20 07:19:43 PDT 2013


I'm trying to extract a table from PostGIS into a shapefile. Using the

"c:\Program Files\Quantum GIS Lisboa\bin\ogr2ogr.exe" -f "ESRI Shapefile"
c:\test\planning.shp PG:"host=w2k3nnpgis1 user=postgres dbname=mapdata
password=********" "dm_planning-apps"
And I get this error: 

ERROR 1: No field definitions found for 'dm_planning-apps', is it a table? 
FAILURE: Couldn't fetch requested layer 'dm_planning-apps'! 

Using the same command with a different db connection works fine. The
difference being that the failure happens on PostgreSQL 9.1.4 with PostGIS
2.0 installed, and I think the other db is on an older installation (I don't
manage the working one).
Judging by other posts it seems like ogr2ogr thinks that the data isn't in
the geomety_columns table, however I notice PostGIS 2.0 has replaced the
geometry columns table with a 'view'. Might this be anything to do with it?
Many thanks if anyone can help with this. 

View this message in context: http://osgeo-org.1560.n6.nabble.com/ogr2ogr-and-PostGIS-2-0-tp5041735.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.

More information about the gdal-dev mailing list