[Gdal-dev] ogr2ogr generate SQL sintax error

Richard Rossel henhiskan at gmail.com
Sun Nov 5 19:43:29 EST 2006

Hi list, am newbie here and I bring a big problem with me :(

I try to convert my shapefile into Postgres with ogr2ogr:

ogr2ogr -select "ID,FRC,FOW" -where "FEATTYP = '4110' AND ROUTENUM !=
''" -f "PostgreSQL" PG:"host=localhost user=atlas dbname=atlas"

ERROR 1: INSERT command for new feature failed.
ERROR:  syntax error at or near "INTO" at character 83

Command: INSERT INTO "cheche________nw" (WKB_GEOMETRY , "id", "frc",
"fow") VALUES (INSERT INTO "cheche________nw" (WKB_GEOMETRY , "id",
"frc", "fow") VALUES
 17561001781772, 4, 3)
ERROR 1: Terminating translation prematurely after failed
translation of layer cheche________nw

I found that the problem is that ogr write "INSERT INTO" twice times.
I take that sentence, drop the exra "INSERT INTO" and charge into DB
without problem.
How can fix it, and populate my DB with shapefile date.

I try with shp2pgsql with no result either ;(

Please help


Richard Rossel
Software Enginneer, WOS
Valparaiso - Chile

More information about the Gdal-dev mailing list