引言
PostgreSQL没有自带job机制,但是可以通过pgAgent来实现该功能,在pgAdmin v1.9版本之前,pgAgent是其安装包的一部分,pgAdmin v1.9之后 pgAgent独立成一个单独的软件包。
部署
安装cmake编译工具tar -zxvf cmake-3.11.0-rc1.tar.gzcd cmake-3.11.0-rc1/./configure --prefix=/opt/cmake3.11gmakegmake install安装wxGTKyum -y install gtk2-devel binutils-develtar -jxvf wxGTK-2.8.12.tarcd wxGTK-2.8.12/./configure --enable-shared=no --enable-unicode=yes --prefix=/opt/wxGTK-2.8.12makemake install配置环境变量cd ~vi .bash_profileexport PATH=/opt/pgagent/bin:/opt/wxGTK-2.8.12/bin:/opt/cmake3.11/bin:/opt/pgsql101/bin:$PATHexport LD_LIBRARY_PATH=/opt/wxGTK-2.8.12/lib:$LD_LIBRARY_PATHsource .bash_profile编译安装pgAgenttar -zxvf pgAgent-3.2.1-Source.tar.gzcd pgAgent-3.2.1-Source/ccmake ./生成配置CMAKE_BUILD_TYPECMAKE_INSTALL_PREFIX 修改为此项 opt/pgagentPG_CONFIG_PATH /opt/pgsql101/bin/pg_configSTATIC_BUILD ONWX_CONFIG_PATH /opt/wxGTK-2.8.12/bin/wx-configWX_DEBUG OFF按c配置,然后按g产生配置接下来就可以编译安装了makemake installsu - pg10在本地库的postgres库中创建调度信息, 表, 函数 :psql -h 127.0.0.1 -p 5432 -U postgres -d postgres -f opt/pgagent/share/pgagent.sql

参考
https://www.pgadmin.org/docs/pgadmin4/1.x/pgagent.html
https://wenku.baidu.com/view/45559dc16429647d27284b73f242336c1eb930f8.html
http://blog.csdn.net/hai520ny/article/details/52439036
文章转载自CP的PostgreSQL厨房,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




