[Gdal-dev] OGR and support for older PostGIS DBs?

Frank Warmerdam fwarmerdam at gmail.com
Thu Aug 4 00:58:31 EDT 2005


On 8/3/05, Markus Neteler <neteler at itc.it> wrote:
> label: String (0.0)
> OGR_PG: PQexec(DECLARE OGRPGLayerReader CURSOR for SELECT "ogc_fid", AsEWKT("wkb_geometry"), "cat", "label" FROM "streams_pg" )
> OGR_PG_NOTICE: WARNING:  PerformPortalClose: portal "ogrpglayerreader" not found

Markus,

I applogise.  This looks like the PostGIS version was improperly
determined as 1.0 or later since the AsEWKT() is being used.

I tried reproducing your problem here on my postgis 0.7 install, but
now a recent batch of changes from Oleg have completely broken
pre-PostGIS 1.0 support.

Oleg, 
 
First postgis_lib_version() does not exist before PostGIS 1.0 so there is
no point using it to test the version. 

Second, the query:

              hResult = PQexec(hPGConn,
                             "DECLARE mycursor CURSOR for "
                             "SELECT c.relname FROM pg_class c,
geometry_columns g "
                             "WHERE (c.relkind in ('r','v') AND
c.relname !~ '^pg' "
                             "AND c.relname = g.f_table_name)" );

Is failing on my PostGIS 0.7 system with the error message:

"Unable to identify an operator '=' for types 'name' and 'varchar'
 You will have to retype this query using an explicit cast"

I'm not clear why, but clearly you are doing something PostgreSQL 8
specific.   Could you please setup a PostGIS 0.7 on PostgreSQL 7.x
and fixup your code to be compatible.  If this isn't practical, then we
should backout your recent changes, and I can workout any other
outstanding issues with PostGIS 0.7 support. 

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    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list