[gdal-dev] joining shapefile to PG table

Even Rouault even.rouault at mines-paris.org
Thu Jul 7 16:17:41 EDT 2011


Le jeudi 07 juillet 2011 21:57:31, William Kyngesburye a écrit :
> I'm having a problem joining a Postgres table to a shapefile.  I've done
> this in the past with MySQL tables.
> 
> ogrinfo -al -so myshapefile.shp -sql "SELECT * FROM myshapefile LEFT JOIN
> 'PG:dbname=mypgdb host=localhost user=someuser password='.mypgtable ON
> myshapefile.keyfield = mypgtable.keyfield" INFO: Open of `myshqpefile.shp'
>       using driver `ESRI Shapefile' successful.
> ERROR 1: SQL Expression Parsing Error: syntax error

William,

I've just tried something really close to the above and it works in trunk and 
1.8.1.

I get a segfault in 1.8.0, but the segfault can only occur if SQL parsing is 
successfull. So I don't understand why you get the SQL parsing error. I guess 
you pasted a simplified/reworked version of your exact SQL, so maybe check it 
once more...

As far as the segfault is concerned, this is an identified regression of 1.8.0 
that has been addressed in to-be-soon-released-1.8.1 (see 
http://trac.osgeo.org/gdal/ticket/4112)

Best regards,

Even


More information about the gdal-dev mailing list