2012-04-23 42 views
0

我嘗試安裝了PostGIS適用於MacOS X和uptil現在這是我得到無法在Mac OS X創建GeoDjango內置空間數據庫

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 Raster?

此外,當我按照tutorial我收到此錯誤

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

然後我檢查的命令

sudo su - postgres 

,併爲echo $?

回答

0

返回1,這意味着PostGIS的是如第一行所示。

通常您會繼續使用makemake install。完成這些之後,您將準備好PostGIS庫,但是您必須在數據庫級別創建PostGIS支持功能,如下所示:psql -c spatial_ref_sys.sql

我會建議諮詢official docs

您的錯誤消息意味着您嘗試連接到數據庫與用戶/到不存在的數據庫。默認情況下,PostgreSQL工具將嘗試與您當前的unix用戶相匹配的用戶名/數據庫,這似乎是root

並記住,在root帳戶下工作是非常糟糕的做法。