[gdal-dev] Ogr2ogr Pgeo to SQL?

Frank Warmerdam warmerdam at pobox.com
Wed Apr 23 12:11:53 EDT 2008

Dane Springmeyer wrote:
> Hi,
> I've been using the PGeo driver on a windows machine to convert ESRI 
> geodatabases/Access Databases (.mdb) to shapefiles (I have not got the 
> driver working yet on linux). Now, I'd like to send directly to 
> PostgreSQL (so all of my column names are not truncated), but I run my 
> Postgres Server on a separate, non networked linux machine. As such, I'd 
> like to use Ogr2ogr to create intermediate output, ideally a sql insert 
> statement like shp2pgsql does.
> My sense is that the ogr2ogr utility is not built this way (there is no 
> SQL format specifically) and I'd be best off to actually spend the time 
> to network my machines. Anyone have suggestions about other approaches? 
> Perhaps there is a crafty way to capture the insert statement ogr2ogr is 
> making and write it to a file?


There is no mechanism provided for capturing the Postgres insert statements.

I would suggest solving the networking problem.

But if that is impractical, you could also look at using more expressive
intermediate file formats like GML, SQLite for the intermediate files.

Best regards,
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org

More information about the gdal-dev mailing list