3

I am trying to add PostGIS functionality to a database that I created in PostgreSQL using the following command: psql -d <db_name> -f /location/to/this/file/postgis.sql

However, I receive a bunch of errors relating to 'geometry does not exist', but on line 1 of these error messages, it says ERROR: could not access file “$libdir/postgis-1.5”.

I Google'd and checked StackOverflow, and it seems like this error is related to dependencies or scripts not being installed. I installed PostGIS using yum install postgis84. I did not see any dependencies except for proj. Based on these instructions, it seems like I will need Proj4, GEOS, LibXML2, GDAL, JSON-C, etc.

Is there a repository that I can connect to that will let me install PostGIS with all the crucial dependencies rather than installing them one by one? I am running a Red Hat Enterprise Linux 6.5 server on Amazon EC2.

5
  • X-post from dba.stackexchange.com/q/84855/7788 Commented Dec 11, 2014 at 3:21
  • I am glad you found the solution. I meant to ask though, why you are installing this version of PostgreSQL/PostGIS as opposed to the current version which is PG 9.3/PostGIS 2.1? Commented Dec 11, 2014 at 22:18
  • @GetSpatial I am transferring a database from one server to an Amazon EC2 instance. My current database is Postgres 8.4.2/PostGIS 1.5.3. I would like to jump to 9.x eventually. I had already tried transferring the data to Postgres 9.x/PostGIS 2.x, but resulted in errors (due to incompatibility I imagine). I would like to upgrade to the more recent versions of both. Any ideas where I can get started?
    – kaoscify
    Commented Dec 11, 2014 at 22:23
  • 1
    Here is the documentation for upgrading a PostgreSQL cluster. I would read through this as it gives pretty good direction. What might have to happen, since you are a couple of major releases behind is that you would have to upgrade in stages. Set up a 9.0 cluster and upgrade to that, then jump to the current release. As they say in the documentation though, they definitely recommend upgrading as opposed to not even though it may be challenging. Upgrading PostgreSQL Commented Dec 11, 2014 at 22:52
  • @GetSpatial Awesome, thanks for this documentation.
    – kaoscify
    Commented Dec 11, 2014 at 23:15

1 Answer 1

3

I solved it. I found the RPM's for GDAL, GEOS, and Proj4. They are located here: http://yum.postgresql.org/9.2/redhat/rhel-6-x86_64/

Since they are not packaged with PostgreSQL 8.4, you have to install them one by one.

I hope this helps someone in future.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.