You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在GitHub Actions的Windows主机(无Docker)中启用PostGIS

Windows 环境安装 PostGIS 方案
  • 先确认已安装的PostgreSQL版本,在Workflow中执行命令:psql --version
  • 下载与PostgreSQL版本、系统架构匹配的PostGIS离线安装包(可从OSGeo官方渠道获取),用PowerShell命令下载:
    Invoke-WebRequest -Uri "对应PostGIS安装包的下载地址" -OutFile "postgis-setup.exe"
    
  • 执行静默安装(安装路径需与已有的PostgreSQL路径一致):
    .\postgis-setup.exe /S /D="C:\Program Files\PostgreSQL\你的版本号"
    
  • 进入PostgreSQL命令行启用PostGIS扩展:
    psql -U postgres -d 你的数据库名 -c "CREATE EXTENSION postgis;"
    
macOS 环境安装 PostGIS 方案
  • GitHub Actions的Mac虚拟机默认预装Homebrew,直接用它安装对应版本的PostGIS:
    brew install postgis@你的PostgreSQL版本号
    
  • 将PostGIS链接到已安装的PostgreSQL环境:
    brew link postgis@你的PostgreSQL版本号 --force
    
  • 启用PostGIS扩展:
    psql -U postgres -d 你的数据库名 -c "CREATE EXTENSION postgis;"
    

内容的提问来源于stack exchange,提问作者Yuri Astrakhan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.15 06:55:17