[Gdal-dev] ogr2ogr segfaults with large SQL statement

Frank Warmerdam warmerdam at pobox.com
Tue Apr 4 23:08:44 EDT 2006


Bruce Raup wrote:
> Hello Frank, and all,
> 
> This is a continuation of an old thread.  I downloaded the CVS version
> of GDAL/OGR yesterday ('gdal-cvs-2006.04.03') to see if your (Frank's)
> patch to remove the limit on query length solved our problem with
> version 1.6.  It doesn't.
> 
> - The old version (I think 1.6, although ogr2ogr -v doesn't show the
> version number) can query a view from a PostGIS database, but the CVS
> version cannot.

Bruce,

I'm not too sure what version 1.6 is.  Perhaps 1.2.6 of GDAL?

My understanding of the current logic is that it should list all
tables and views that have geometry columns in the list of named
layers.  The current query for layers looks like:

SELECT c.relname FROM pg_class c, geometry_columns g
    WHERE (c.relkind in ('r','v') AND c.relname !~ '^pg'
    AND c.relname::TEXT = g.f_table_name::TEXT)

Hmm, I see the documentation claims views are not supported.  Just
how does one go about creating a named view in Postgres?

I was going to suggest you use the special datasource syntax
for listing explicit tables but I see that isn't supported for
postgres.  Perhaps I need to add it.

> - If the WHERE clause in the SQL statement exceeds around 5000
> characters, it still segfaults.

I have added a test for large attribute filters, and for large
SQL statements to the test suite, and identified a serious bug
which I have corrected.  Large attribute filters should now work
with OGR CVS.

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 OSGF, http://osgeo.org




More information about the Gdal-dev mailing list