[gdal-dev] ogr2ogr PGDUMP not using typmod?

Even Rouault even.rouault at mines-paris.org
Sat Nov 30 09:35:44 PST 2013


Le samedi 30 novembre 2013 17:15:51, Stefano Iacovella a écrit :
> Hi all,
> 
> I am having trouble trying to force ogr2ogr to use the typmod geometry
> column creation using the PGDUMP format.
> I tried to use -lco  POSTGIS_VERSION=2.0 but also with it I find this in
> the output sql file:
> 
> SELECT AddGeometryColumn('public','linee','geom',4326,'LINESTRING',2);
> 
> This is definitely not a big issue as I can easily update the sql file
> before running it, but I wonder if it is just me that can't find the right
> way.

You don't need to do any SQL rewriting, nor the PGDump driver needs changes.
In PostGIS 2.0, according to 
http://postgis.refractions.net/docs/AddGeometryColumn.html, 
AddGeometryColumn() will by default create a typmod geometry colum
I've verified it by issuing a "\d mytable" on a table created with PGDump.

> 
> Thank you for any hint
> 
> Stefano
> 
> ---------------------------------------------------
> 41.95581N 12.52854E
> 
> 
> http://www.linkedin.com/in/stefanoiacovella
> 
> http://twitter.com/#!/Iacovellas

-- 
Geospatial professional services
http://even.rouault.free.fr/services.html


More information about the gdal-dev mailing list