Chinaunix

标题: 安装postgres时出错。 [打印本页]

作者: dfzx    时间: 2005-02-25 10:36
标题: 安装postgres时出错。
我安装postgres如下:
./configure
gmake
su
gmake install
adduser postgres
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
但,使用/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data时出错:
  The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale zh_CN.GB18030.
initdb: could not find suitable encoding for locale "zh_CN.GB18030"
Rerun initdb with the -E option.
Try "initdb --help" for more information.

使用/usr/local/pgsql/bin/initdb -E /usr/local/pgsql/d时:
nitdb: no data directory specified
You must identify the directory where the data for this database system
will reside.  Do this with either the invocation option -D or the
environment variable PGDATA.
请问我应怎么做?
作者: abchgd    时间: 2005-02-25 11:14
标题: 安装postgres时出错。
我也碰到过,不过解决了!
在环境变量中增加如下东东:
LC_COLLATE=C
LC_CTYPE=C
export LC_COLLATE LC_CTYPE
一切OK!
作者: dfzx    时间: 2005-02-25 12:43
标题: 安装postgres时出错。
这几个东东是做什么用的?
它真接在./configure里加入吗?
./configure LC_COLLATE=C LC_CTYPE=C export LC_COLLATE LC_CTYPE
configure: WARNING: you should use --build, --host, --target
configure: WARNING: you should use --build, --host, --target
configure: WARNING: you should use --build, --host, --target
checking build system type... Invalid configuration `export': machine `export' not recognized
configure: error: /bin/sh config/config.sub export failed
好像不行.
作者: abchgd    时间: 2005-02-25 12:52
标题: 安装postgres时出错。
加在post用户的.profile文件里
作者: dfzx    时间: 2005-02-25 14:04
标题: 安装postgres时出错。
.bash_profile内容如下:
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATHHOME/bin

export PATH
unset USERNAME
应放在哪个位置?
作者: abchgd    时间: 2005-02-25 14:14
标题: 安装postgres时出错。
放在哪里无所谓,如下即可:

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATHHOME/bin

LC_COLLATE=C
LC_CTYPE=C
export LC_COLLATE LC_CTYPE

export PATH
unset USERNAME
作者: dfzx    时间: 2005-02-25 14:55
标题: 安装postgres时出错。
在运行/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale zh_CN.GB18030.
initdb: could not find suitable encoding for locale "zh_CN.GB18030"
Rerun initdb with the -E option.
Try "initdb --help" for more information.
这个zh_CN.GB18030是什么东东?
作者: dingjeff    时间: 2005-02-25 18:29
标题: 安装postgres时出错。
这个zh_CN.GB18030是什么东东?]

是最新的中文国际化标准。
作者: dfzx    时间: 2005-02-25 20:27
标题: 安装postgres时出错。
那我应怎么做?
作者: abchgd    时间: 2005-02-25 21:07
标题: 安装postgres时出错。
你的.profile里是不是没有以下变量:
USER=postgres
LD_LIBRARY_PATH=/usr/local/pgsql/lib
export USER LD_LIBRARY_PATH
作者: dfzx007    时间: 2005-02-28 14:04
标题: 安装postgres时出错。
没有这些东东。
我的.bash_profile如下:


# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATHHOME/bin
LC_COLLATE=C
LC_CTYPE=C

export PATH
unset USERNAME
作者: abchgd    时间: 2005-02-28 15:59
标题: 安装postgres时出错。
我的.profile文件主要内容,参考一下吧:
PATH=$PATH:/usr/local/pgsql/bin:/usr/local/bin
MANPATH=$MANPATH:/usr/local/pgsql/man
PGLIB=/usr/local/pgsql/lib
PGDATA=/usr/local/pgsql/data
USER=postgres
LD_LIBRARY_PATH=/usr/local/pgsql/lib
LC_COLLATE=C
LC_CTYPE=C

export PATH MANPATH PGLIB PGDATA USER
export LD_LIBRARY_PATH LC_COLLATE LC_CTYPE




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2