【问题标题】:Unable to create spatial database for geodjango on Mac OS X无法在 Mac OS X 上为 geodjango 创建空间数据库
【发布时间】:2012-04-23 19:27:32
【问题描述】:

我正在尝试为 MacOS X 安装 PostGIS,直到现在这就是我得到的

PostGIS is now configured for x86_64-apple-darwin10.8.0

 -------------- Compiler Info ------------- 
  C compiler:           gcc -g -O2
  C++ compiler:         g++ -g -O2

 -------------- Dependencies -------------- 
  GEOS config:          /usr/local/bin/geos-config
  GEOS version:         3.3.3
  PostgreSQL config:    /usr/local/pgsql/bin/pg_config
  PostgreSQL version:   PostgreSQL 9.1.3
  PROJ4 version:        48
  Libxml2 config:       /usr/bin/xml2-config
  Libxml2 version:      2.7.3
  JSON-C support:       yes
  PostGIS debug level:  0
  Perl:                 /usr/bin/perl

 --------------- Extensions --------------- 
  PostGIS Raster:       disabled
  PostGIS Topology:     enabled

 -------- Documentation Generation -------- 
  xsltproc:             /usr/bin/xsltproc
  xsl style sheets:     
  dblatex:              
  convert:              
  mathml2.dtd:          http://www.w3.org/Math/DTD/mathml2/mathml2.dtd

这是否意味着 PostGIS 现在已安装?为什么禁用 PostGIS 栅格?

另外,当我关注tutorial 时,我收到此错误

createdb -E UTF8 template_postgis
createdb: could not connect to database postgres: FATAL:  role "root" does not exist

然后我检查了命令

sudo su - postgres

它为echo $?返回1

【问题讨论】:

    标签: macos postgresql postgis geodjango


    【解决方案1】:

    这意味着 PostGIS 已配置,如第一行所述。

    通常您继续使用makemake install。完成此操作后,您将准备好 PostGIS 库,但您必须在数据库级别创建 PostGIS 支持函数,如下所示:psql -c spatial_ref_sys.sql

    我建议您也咨询official docs

    您的错误消息意味着您正在尝试使用该用户 / 连接到该数据库中不存在的数据库。默认情况下,PostgreSQL 工具会尝试与您当前的 unix 用户匹配的用户名/数据库,这似乎是root

    请记住,在root 帐户下工作是一种非常糟糕的做法。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-05-07
      • 1970-01-01
      • 2013-01-05
      • 2011-02-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-14
      相关资源
      最近更新 更多