1

I'm trying to get postsql and postgis to work together, but keep running into the same issue.

Using: PostgreSQL 9.2.3 (postgres.app)

when I run:

CREATE EXTENSION postgis;  
ERROR:  could not access file "$libdir/postgis-2.0": No such file or directory

I also get the same error when I run:

$psql -d myDB -f postgis.sql

psql:postgis.sql:49: ERROR:  could not access file "$libdir/postgis-2.0": No such file or directory

When I check my $libdir

$pg_config --libdir  
/Applications/Postgres.app/Contents/MacOS/lib  
$pg_config --pkglibdir  
/Applications/Postgres.app/Contents/MacOS/lib

And if I check the directory I find a file: postgis-2.0.so

I've been hitting my head against this for a few days and can't figure it out.

Chris Travers
  • 25,424
  • 6
  • 65
  • 182
ejm2095
  • 11
  • 1
  • 1
    Are you absolutely certain that you're connecting to the Pg from postgres.app, not some other Pg install on the system? Also: on some platforms "no such file or directory" is reporeted when the library exists *but libraries it depends on do not* so try `ldd` or whatever OS X's equivalent is to see if there could be missing dependencies for `postgis-2.0.so` – Craig Ringer Apr 03 '13 at 02:13

1 Answers1

0

I reinstalled postgres using the kyngchaos distribution and that sorted this problem -- I had previously compiled it myself from source. If you have data you would rather not replace, you can upgrade your data directory and point KyngCHAOS to it, using the PGDATA environment variable. Good luck and I hope you sort your problem. Do leave a comment, if you have further questions, though.

hd1
  • 33,938
  • 5
  • 80
  • 91