关于Linux系统下PostgreSQL添加uuid组件的步骤

2014-11-24 17:53:20 · 作者: · 浏览: 1

值得注意的地方


1.find / -name uuid-ossp.so搜索看看时候存在


2.安装postgresql.的时候 如果报错。


checking for uuid_export in -lossp-uuid... no
checking for uuid_export in -luuid... no
configure: error: library 'ossp-uuid' or 'uuid' is required for OSSP-UUID"
那一定是没有安装UUID包。也就是第一步没有做好。
./configure --with-libxml --with-ossp-uuid --with-libs=/usr/local/lib --with-includes=/usr/local/include


这个时候通过安装。


3。添加组件


进入cd post安装包目录/contrib/uuid-ossp/


make && make install


4配置环境变量


/etc/profile


PGLIB=/usr/local/pgsql/lib
PGDATA=$HOME/data
PATH=$PATH:/usr/local/pgsql/bin
MANPATH=$MANPATH:/usr/local/pgsql/man
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export PGLIB PGDATA PATH MANPATH


source /etc/profile


第四步。


进入su postgres用户


psql -U postgres -d mydb < /usr/local/pgsql/share/contrib/uuid-ossp.sql 其中


mydb为自己建立的数据库


其中损去很多代码。