[postgis-users] Problem enabling postgis (Mac OS)

William Kyngesburye woklist at kyngchaos.com
Sat Aug 11 20:51:07 PDT 2012

On Aug 11, 2012, at 8:35 PM, António Rodrigues wrote:

> Hi list,
> I'm having problems enabling postgis on a mac running Mountain Lion. Most likely this is due to my absolute lack of experience with postgresql, but I've read the documentation, searched the web and so far, no luck.
> This is what I've done
> Installed GDAL_Complete-1.9.dmg, PostgreSQL-9.1.4-1.dmg and PostGIS-2.0.1-1.dmg from kyngchaos (in this order)
> During installation, I was not prompted for a postgres password, hence I had problems when connecting as user (role) postgres.

This is normal - no password is set for the postgres role on installation.  Local connections to postgres are all allowed without a password, and no external connections are allowed at all, in the default configuration (pg_hba.conf), so it should work, but the readme suggests setting a password (especially if you install it on a shared computer).

> In pgadmin I created a new role as superuser.
> ----------
> From PostGIS documentation, I tried (in the psql console plugin…
> (p.14 in PostGIS 2.0.0 Manual)
> createdb db1
> createlang plpgsql db1
> psql -d db1 -f postgis.sql
> psql -d db1 -f spatial_ref_sys.sql
> psql -d db1 -f postgis_comments.sql
> psql -d db1 -f rtpostgis.sql
> psql -d db1 -f raster_comments.sql
> psql -d db1 -f topology/topology.sql
> psql -d db1 -f topology/topology_comments.sql
> psql -d db1 -f legacy.sql
> Nothing new: no postgis functions...
> Then Using the psql console plugin I typed:
> (p. 15PostGIS 2.0.0 Manual)
> psql -d db -c "CREATE EXTENSION postgis;"
> psql -d db -c "CREATE EXTENSION postgis_topology;"
> Again no good.

The problem may be that without any user flag, psql uses your system login name to connect to postgres.  If you don't setup your login name as a postgres role, you won't connect.  You need to add to your psql connection:

-U postgres

or other role with full permissions on the DB (I don't think you need superuser perms, only the superfluous createlang step in the old method did).

note: stick with the extension method - easier to install and upgrade.

> Then I pasted the code in from postgis.sql (from \usr\…contrib\postgis2.0 directly in a sql window in pgadmin…
> I got the error message: "ERROR:  could not access file "$libdir/postgis-2.0": No such file or directory"
> ----------
> I am aware this is a newby kind of problem, and I apologize for that, but some help would be really really great.
> Thanks,
> Pedro
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users

William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>

Theory of the Universe

There is a theory which states that if ever anyone discovers exactly what the universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarrely inexplicable.  There is another theory which states that this has already happened.

-Hitchhiker's Guide to the Galaxy 2nd season intro

More information about the postgis-users mailing list