在OpenBSD上配置PostgreSQL

当Postgresql安装完成后,我们进行以下操作

su-_postgresql
initdb-D/var/postgresql/data-Upostgres-EUTF8-Amd5-W

之后我们需要配置自动启动

OpenBSD 5.6版本

配置自动启动rc.local

if[-x/usr/local/bin/pg_ctl];then
echo-n'postgresql'
su-l_postgresql-c"nohup/usr/local/bin/pg_ctlstart\
-D/var/postgresql/data-l/var/postgresql/logfile\
-o'-D/var/postgresql/data'>/dev/null"
fi

配置自动停止

if[-f/var/postgresql/data/postmaster.pid];then
su-l_postgresql-c"/usr/local/bin/pg_ctlstop-mfast\
-D/var/postgresql/data"
rm-f/var/postgresql/data/postmaster.pid
fi

OpenBSD 5.7版本

在rc.conf.local中添加

pkg_scripts=postgresql

或使用新的rcctl工具

rcctlenablepostgresql

相关文章

项目需要,有个数据需要导入,拿到手一开始以为是mysql,结果...
本文小编为大家详细介绍“怎么查看PostgreSQL数据库中所有表...
错误现象问题原因这是在远程连接时pg_hba.conf文件没有配置正...
因本地资源有限,在公共测试环境搭建了PGsql环境,从数据库本...
wamp 环境 这个提示就是说你的版本低于10了。 先打印ph...
psycopg2.OperationalError: SSL SYSCALL error: EOF detect...