[ELGIS] Version Conflicts with EPEL postgis

Bill Thoen bthoen at gisnet.com
Sat Oct 15 14:07:24 EDT 2011


I thought was out of the woods trying recover my database after going back from postgres 9.0 to the ELGIS-compatible 8.4, but no. Now I'm having trouble restoring functions when I try to set up postgis. When I attempt to restore the backup made with "dumpall" it reports an error of incompatible libraries, then it fails on all the rest until it reaches the end of the transaction and does a ROLLBACK.

Here's the error:

psql:/usr/share/pgsql/contrib/lwpostgis.sql:44: 
  NOTICE:  type "histogram2d" is not yet defined
  DETAIL:  Creating a shell type definition.
psql:/usr/share/pgsql/contrib/lwpostgis.sql:44: 
  ERROR:  incompatible library "/usr/lib64/pgsql/liblwgeom.so": missing magic block
  HINT:  Extension libraries are required to use the    
    PG_MODULE_MAGIC macro.

The code it's trying to execute is:
CREATE FUNCTION box2d_in(cstring) RETURNS box2d
    LANGUAGE c IMMUTABLE STRICT
    AS '$libdir/postgis-1.5', 'BOX2DFLOAT4_in';

Well, obviously the version of postgis that I used with PostgreSQL version 9 doesn't match the version I need to use with Pg ver 8.4. That's this one:

postgis.x86_64 0:1.3.2-1.el5
postgis-utils.x86_64 0:1.3.2-1.el5

So then I thought I could just cut out that section from the "dumpall" script and install the postgis functions manually. I cleaned out the fragments of postgis that did get into the database and I entered the  following as a postgres superuser:

CREATE LANGUAGE PLPGSQL
# \i /usr/share/pgsql/contrib/lwpostgis.sql

And got this:

psql:/usr/share/pgsql/contrib/lwpostgis.sql:44: 
  NOTICE:  type "histogram2d" is not yet defined
  DETAIL:  Creating a shell type definition.
psql:/usr/share/pgsql/contrib/lwpostgis.sql:44: 
ERROR:  incompatible library "/usr/lib64/pgsql/liblwgeom.so": missing magic block
HINT:  Extension libraries are required to use the PG_MODULE_MAGIC macro.

What am I doing wrong? How do I get postgis working?

TIA,
Bill Thoen
GISnet
http://gisnet.com
303-786-9961


More information about the el mailing list