[gdal-dev] Re: ogr2ogr PGSQL_OGR_FID is not work

Jukka Rahkonen jukka.rahkonen at mmmtike.fi
Mon Feb 1 10:06:19 EST 2010


 <Christian.Strobl <at> dlr.de> writes:


> if i try the following command
> 
> ogr2ogr -f PostgreSQL -nln newlayer -nlt MULTIPOLYGON PG:"host=localhost
user=admin password=xxx
> dbname=mydb" PG:"host=localhost user=admin password=yyy dbname=otherdb"
oldlayer -lco PGSQL_OGR_FID=myid
> 
> everything works fine but the primary key remains at the column "ogc_fid" not
at the column "myid". 
> 
> thanks for every help


Hi,

I have never tried that but it seems to by in the manual page under subtitle
"Environment variables" and not under "Layer creation options".  With Windows it
would mean giving a command

SET PGSQL_OGR_FID=myid from command line before running ogr2ogr. Must be
something similar with Linux.

-Jukka-



More information about the gdal-dev mailing list