• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

CloverHealth/homebrew-tap: Homebrew formulas for Postgres 9.6 and Postgis 2.4

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

CloverHealth/homebrew-tap

开源软件地址:

https://github.com/CloverHealth/homebrew-tap

开源编程语言:

Ruby 100.0%

开源软件介绍:

homebrew-tap

This is Clover Health's Homebrew Tap, which features formulas to help pin Postgres to 9.6 and Postgis to 2.5.

Homebrew will pull in the latest version of formulas when they are upgraded, meaning that users can inadvertently be upgraded to Postgresql 10. The postgresql.rb formula here ensures that 9.6.10 is installed, and the postgis.rb formulate ensures that 2.5.2 is installed.

Installing Postgres 9.6 and Postgis 2.5

First ensure you have upgraded to the latest homebrew:

brew update

It's recommended to go ahead and clear any existing Postgres and Postgis installations:

brew uninstall postgis --force
brew uninstall postgresql --force
brew cleanup
brew services stop postgresql

After this, install Clover's custom brew tap:

brew tap cloverhealth/homebrew-tap

Then install the latest version of Postgres and unlink it. This is done first so that we can explicitly switch to an earlier version before installing Postgis:

brew install postgresql
brew unlink postgresql

The previous install of postgresql runs initdb, which creates database structures incompatible with 9.6.10. This needs to be removed with:

rm -rf /usr/local/var/postgres

Now install Postgres from this tap with:

brew install cloverhealth/tap/postgresql  # yes, without the homebrew-

Now you will have both 9.6.10 and the latest version of Postgres installed. Switch to 9.6.10 with:

brew switch postgresql 9.6.10

Postgis 2.5 can be installed with:

brew install cloverhealth/tap/postgis

Try running and accessing Postgres with the following:

brew services start postgresql
psql postgres  # It should show 9.6.10 as the version on the prompt

After running psql postgres, type the following in the prompt to verify your Postgis installation:

drop extension postgis;  -- This might fail if it wasn't previously installed
create extension postgis;  -- This should pass
select ST_Distance(
  ST_GeometryFromText('POINT(-118.4079 33.9434)', 4326), -- Los Angeles (LAX)
  ST_GeometryFromText('POINT(2.5559 49.0083)', 4326)     -- Paris (CDG)
);  -- This should print a row with 121.898285970107 as a value



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap