Mac 下安装PostgresSQL,最简单的方式就是用这个: http://postgresapp.com/,而且 Postgres.app 中包含了 PostGIS。
参考:http://postgis.net/install/ 这才知道还要手动执行下面代码才能 enable PostGIS
-- Enable PostGIS (includes raster)
CREATE EXTENSION postgis;
-- Enable Topology
CREATE EXTENSION postgis_topology;
-- fuzzy matching needed for Tiger
CREATE EXTENSION fuzzystrmatch;
-- Enable US Tiger Geocoder
CREATE EXTENSION postgis_tiger_geocoder;
psql 中执行:
-- Enable PostGIS (includes raster)
CREATE EXTENSION postgis;
发生错误:
ERROR: could not load library "/Applications/Postgres.app/Contents/MacOS/lib/rtpostgis-2.0.so": dlopen(/Applications/Postgres.app/Contents/MacOS/lib/rtpostgis-2.0.so, 10): Library not loaded: /usr/local/lib/libtiff.5.dylib
Referenced from: /Applications/Postgres.app/Contents/MacOS/lib/libgdal.1.dylib
Reason: image not found
解决办法:
brew install libtiff
在使用 ln 命令!