prestogres 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +20 -0
- data/LICENSE +202 -0
- data/NOTICE +22 -0
- data/README.md +217 -0
- data/Rakefile +13 -0
- data/VERSION +1 -0
- data/bin/prestogres +254 -0
- data/config/pcp.conf.sample +28 -0
- data/config/pgpool.conf +678 -0
- data/config/pool_hba.conf +84 -0
- data/config/pool_passwd +0 -0
- data/config/postgresql.conf +2 -0
- data/ext/.gitignore +6 -0
- data/ext/depend +26 -0
- data/ext/extconf.rb +4 -0
- data/ext/prestogres_config.c +12 -0
- data/pgpool2/.gitignore +36 -0
- data/pgpool2/AUTHORS +4 -0
- data/pgpool2/COPYING +12 -0
- data/pgpool2/ChangeLog +1 -0
- data/pgpool2/INSTALL +1 -0
- data/pgpool2/Makefile.am +159 -0
- data/pgpool2/Makefile.in +1187 -0
- data/pgpool2/NEWS +4960 -0
- data/pgpool2/README +1 -0
- data/pgpool2/README.euc_jp +1 -0
- data/pgpool2/README.online-recovery +62 -0
- data/pgpool2/TODO +103 -0
- data/pgpool2/ac_func_accept_argtypes.m4 +85 -0
- data/pgpool2/aclocal.m4 +1088 -0
- data/pgpool2/c-compiler.m4 +134 -0
- data/pgpool2/c-library.m4 +325 -0
- data/pgpool2/child.c +2097 -0
- data/pgpool2/config.guess +1532 -0
- data/pgpool2/config.h.in +332 -0
- data/pgpool2/config.sub +1640 -0
- data/pgpool2/configure +15752 -0
- data/pgpool2/configure.in +392 -0
- data/pgpool2/depcomp +522 -0
- data/pgpool2/doc/basebackup.sh +17 -0
- data/pgpool2/doc/pgpool-de.html +4220 -0
- data/pgpool2/doc/pgpool-en.html +5738 -0
- data/pgpool2/doc/pgpool-fr.html +4118 -0
- data/pgpool2/doc/pgpool-ja.css +198 -0
- data/pgpool2/doc/pgpool-ja.html +11279 -0
- data/pgpool2/doc/pgpool-zh_cn.html +4445 -0
- data/pgpool2/doc/pgpool.css +280 -0
- data/pgpool2/doc/pgpool_remote_start +13 -0
- data/pgpool2/doc/recovery.conf.sample +117 -0
- data/pgpool2/doc/tutorial-en.html +707 -0
- data/pgpool2/doc/tutorial-ja.html +422 -0
- data/pgpool2/doc/tutorial-memqcache-en.html +325 -0
- data/pgpool2/doc/tutorial-memqcache-ja.html +370 -0
- data/pgpool2/doc/tutorial-memqcache-zh_cn.html +322 -0
- data/pgpool2/doc/tutorial-watchdog-en.html +306 -0
- data/pgpool2/doc/tutorial-watchdog-ja.html +343 -0
- data/pgpool2/doc/tutorial-watchdog-zh_cn.html +301 -0
- data/pgpool2/doc/tutorial-zh_cn.html +537 -0
- data/pgpool2/doc/watchdog.png +0 -0
- data/pgpool2/doc/wd-en.html +236 -0
- data/pgpool2/doc/wd-en.jpg +0 -0
- data/pgpool2/doc/wd-ja.html +219 -0
- data/pgpool2/doc/wd-ja.jpg +0 -0
- data/pgpool2/doc/wd-zh_cn.html +201 -0
- data/pgpool2/doc/where_to_send_queries.odg +0 -0
- data/pgpool2/doc/where_to_send_queries.pdf +0 -0
- data/pgpool2/general.m4 +166 -0
- data/pgpool2/getopt_long.c +200 -0
- data/pgpool2/getopt_long.h +44 -0
- data/pgpool2/install-sh +251 -0
- data/pgpool2/ltmain.sh +8406 -0
- data/pgpool2/m4/libtool.m4 +7360 -0
- data/pgpool2/m4/ltoptions.m4 +368 -0
- data/pgpool2/m4/ltsugar.m4 +123 -0
- data/pgpool2/m4/ltversion.m4 +23 -0
- data/pgpool2/m4/lt~obsolete.m4 +92 -0
- data/pgpool2/main.c +2971 -0
- data/pgpool2/md5.c +444 -0
- data/pgpool2/md5.h +28 -0
- data/pgpool2/missing +360 -0
- data/pgpool2/mkinstalldirs +40 -0
- data/pgpool2/parser/Makefile.am +50 -0
- data/pgpool2/parser/Makefile.in +559 -0
- data/pgpool2/parser/copyfuncs.c +3310 -0
- data/pgpool2/parser/gram.c +39100 -0
- data/pgpool2/parser/gram.h +940 -0
- data/pgpool2/parser/gram.y +13408 -0
- data/pgpool2/parser/gramparse.h +74 -0
- data/pgpool2/parser/keywords.c +32 -0
- data/pgpool2/parser/keywords.h +39 -0
- data/pgpool2/parser/kwlist.h +425 -0
- data/pgpool2/parser/kwlookup.c +88 -0
- data/pgpool2/parser/list.c +1156 -0
- data/pgpool2/parser/makefuncs.c +518 -0
- data/pgpool2/parser/makefuncs.h +83 -0
- data/pgpool2/parser/memnodes.h +79 -0
- data/pgpool2/parser/nodes.c +29 -0
- data/pgpool2/parser/nodes.h +609 -0
- data/pgpool2/parser/outfuncs.c +5790 -0
- data/pgpool2/parser/parsenodes.h +2615 -0
- data/pgpool2/parser/parser.c +262 -0
- data/pgpool2/parser/parser.h +46 -0
- data/pgpool2/parser/pg_class.h +158 -0
- data/pgpool2/parser/pg_config_manual.h +273 -0
- data/pgpool2/parser/pg_list.h +352 -0
- data/pgpool2/parser/pg_trigger.h +147 -0
- data/pgpool2/parser/pg_wchar.h +492 -0
- data/pgpool2/parser/pool_memory.c +342 -0
- data/pgpool2/parser/pool_memory.h +77 -0
- data/pgpool2/parser/pool_parser.h +222 -0
- data/pgpool2/parser/pool_string.c +121 -0
- data/pgpool2/parser/pool_string.h +37 -0
- data/pgpool2/parser/primnodes.h +1280 -0
- data/pgpool2/parser/scan.c +4094 -0
- data/pgpool2/parser/scan.l +1451 -0
- data/pgpool2/parser/scanner.h +120 -0
- data/pgpool2/parser/scansup.c +221 -0
- data/pgpool2/parser/scansup.h +28 -0
- data/pgpool2/parser/snprintf.c +1102 -0
- data/pgpool2/parser/stringinfo.c +294 -0
- data/pgpool2/parser/stringinfo.h +178 -0
- data/pgpool2/parser/value.c +78 -0
- data/pgpool2/parser/value.h +62 -0
- data/pgpool2/parser/wchar.c +2048 -0
- data/pgpool2/pcp.conf.sample +28 -0
- data/pgpool2/pcp/Makefile.am +40 -0
- data/pgpool2/pcp/Makefile.in +771 -0
- data/pgpool2/pcp/libpcp_ext.h +250 -0
- data/pgpool2/pcp/md5.c +444 -0
- data/pgpool2/pcp/md5.h +28 -0
- data/pgpool2/pcp/pcp.c +1652 -0
- data/pgpool2/pcp/pcp.h +61 -0
- data/pgpool2/pcp/pcp_attach_node.c +172 -0
- data/pgpool2/pcp/pcp_detach_node.c +185 -0
- data/pgpool2/pcp/pcp_error.c +87 -0
- data/pgpool2/pcp/pcp_node_count.c +160 -0
- data/pgpool2/pcp/pcp_node_info.c +198 -0
- data/pgpool2/pcp/pcp_pool_status.c +166 -0
- data/pgpool2/pcp/pcp_proc_count.c +166 -0
- data/pgpool2/pcp/pcp_proc_info.c +261 -0
- data/pgpool2/pcp/pcp_promote_node.c +185 -0
- data/pgpool2/pcp/pcp_recovery_node.c +172 -0
- data/pgpool2/pcp/pcp_stop_pgpool.c +179 -0
- data/pgpool2/pcp/pcp_stream.c +385 -0
- data/pgpool2/pcp/pcp_stream.h +52 -0
- data/pgpool2/pcp/pcp_systemdb_info.c +194 -0
- data/pgpool2/pcp/pcp_watchdog_info.c +211 -0
- data/pgpool2/pcp_child.c +1493 -0
- data/pgpool2/pg_md5.c +305 -0
- data/pgpool2/pgpool.8.in +121 -0
- data/pgpool2/pgpool.conf +553 -0
- data/pgpool2/pgpool.conf.sample +666 -0
- data/pgpool2/pgpool.conf.sample-master-slave +665 -0
- data/pgpool2/pgpool.conf.sample-replication +664 -0
- data/pgpool2/pgpool.conf.sample-stream +664 -0
- data/pgpool2/pgpool.spec +264 -0
- data/pgpool2/pgpool_adm/TODO +7 -0
- data/pgpool2/pgpool_adm/pgpool_adm--1.0.sql +85 -0
- data/pgpool2/pgpool_adm/pgpool_adm.c +558 -0
- data/pgpool2/pgpool_adm/pgpool_adm.control +5 -0
- data/pgpool2/pgpool_adm/pgpool_adm.h +46 -0
- data/pgpool2/pgpool_adm/pgpool_adm.sql.in +85 -0
- data/pgpool2/pool.h +655 -0
- data/pgpool2/pool_auth.c +1390 -0
- data/pgpool2/pool_config.c +5007 -0
- data/pgpool2/pool_config.h +284 -0
- data/pgpool2/pool_config.l +3281 -0
- data/pgpool2/pool_config_md5.c +29 -0
- data/pgpool2/pool_connection_pool.c +812 -0
- data/pgpool2/pool_error.c +242 -0
- data/pgpool2/pool_globals.c +27 -0
- data/pgpool2/pool_hba.c +1723 -0
- data/pgpool2/pool_hba.conf.sample +67 -0
- data/pgpool2/pool_ip.c +567 -0
- data/pgpool2/pool_ip.h +65 -0
- data/pgpool2/pool_ipc.h +38 -0
- data/pgpool2/pool_lobj.c +242 -0
- data/pgpool2/pool_lobj.h +32 -0
- data/pgpool2/pool_memqcache.c +3818 -0
- data/pgpool2/pool_memqcache.h +268 -0
- data/pgpool2/pool_params.c +163 -0
- data/pgpool2/pool_passwd.c +249 -0
- data/pgpool2/pool_passwd.h +41 -0
- data/pgpool2/pool_path.c +193 -0
- data/pgpool2/pool_path.h +81 -0
- data/pgpool2/pool_process_context.c +247 -0
- data/pgpool2/pool_process_context.h +62 -0
- data/pgpool2/pool_process_query.c +5001 -0
- data/pgpool2/pool_process_reporting.c +1671 -0
- data/pgpool2/pool_process_reporting.h +44 -0
- data/pgpool2/pool_proto2.c +671 -0
- data/pgpool2/pool_proto_modules.c +3524 -0
- data/pgpool2/pool_proto_modules.h +185 -0
- data/pgpool2/pool_query_cache.c +1020 -0
- data/pgpool2/pool_query_context.c +1871 -0
- data/pgpool2/pool_query_context.h +105 -0
- data/pgpool2/pool_relcache.c +284 -0
- data/pgpool2/pool_relcache.h +78 -0
- data/pgpool2/pool_rewrite_outfuncs.c +9060 -0
- data/pgpool2/pool_rewrite_query.c +715 -0
- data/pgpool2/pool_rewrite_query.h +192 -0
- data/pgpool2/pool_select_walker.c +1150 -0
- data/pgpool2/pool_select_walker.h +68 -0
- data/pgpool2/pool_sema.c +161 -0
- data/pgpool2/pool_session_context.c +952 -0
- data/pgpool2/pool_session_context.h +203 -0
- data/pgpool2/pool_shmem.c +185 -0
- data/pgpool2/pool_signal.c +158 -0
- data/pgpool2/pool_signal.h +61 -0
- data/pgpool2/pool_ssl.c +339 -0
- data/pgpool2/pool_stream.c +962 -0
- data/pgpool2/pool_stream.h +61 -0
- data/pgpool2/pool_system.c +659 -0
- data/pgpool2/pool_timestamp.c +1215 -0
- data/pgpool2/pool_timestamp.h +38 -0
- data/pgpool2/pool_type.h +171 -0
- data/pgpool2/pool_worker_child.c +384 -0
- data/pgpool2/ps_status.c +404 -0
- data/pgpool2/recovery.c +435 -0
- data/pgpool2/redhat/pgpool.conf.sample.patch +52 -0
- data/pgpool2/redhat/pgpool.init +201 -0
- data/pgpool2/redhat/pgpool.sysconfig +7 -0
- data/pgpool2/redhat/rpm_installer/basebackup-replication.sh +53 -0
- data/pgpool2/redhat/rpm_installer/basebackup-stream.sh +55 -0
- data/pgpool2/redhat/rpm_installer/config_for_script +17 -0
- data/pgpool2/redhat/rpm_installer/failover.sh +64 -0
- data/pgpool2/redhat/rpm_installer/getsources.sh +141 -0
- data/pgpool2/redhat/rpm_installer/install.sh +1363 -0
- data/pgpool2/redhat/rpm_installer/pgpool_recovery_pitr +47 -0
- data/pgpool2/redhat/rpm_installer/pgpool_remote_start +15 -0
- data/pgpool2/redhat/rpm_installer/recovery.conf +4 -0
- data/pgpool2/redhat/rpm_installer/uninstall.sh +57 -0
- data/pgpool2/sample/dist_def_pgbench.sql +73 -0
- data/pgpool2/sample/pgpool.pam +3 -0
- data/pgpool2/sample/pgpool_recovery +20 -0
- data/pgpool2/sample/pgpool_recovery_pitr +19 -0
- data/pgpool2/sample/pgpool_remote_start +13 -0
- data/pgpool2/sample/replicate_def_pgbench.sql +18 -0
- data/pgpool2/sql/insert_lock.sql +15 -0
- data/pgpool2/sql/pgpool-recovery/pgpool-recovery.c +280 -0
- data/pgpool2/sql/pgpool-recovery/pgpool-recovery.sql.in +19 -0
- data/pgpool2/sql/pgpool-recovery/pgpool_recovery--1.0.sql +24 -0
- data/pgpool2/sql/pgpool-recovery/pgpool_recovery.control +5 -0
- data/pgpool2/sql/pgpool-recovery/uninstall_pgpool-recovery.sql +3 -0
- data/pgpool2/sql/pgpool-regclass/pgpool-regclass.c +206 -0
- data/pgpool2/sql/pgpool-regclass/pgpool-regclass.sql.in +4 -0
- data/pgpool2/sql/pgpool-regclass/pgpool_regclass--1.0.sql +7 -0
- data/pgpool2/sql/pgpool-regclass/pgpool_regclass.control +5 -0
- data/pgpool2/sql/pgpool-regclass/uninstall_pgpool-regclass.sql +1 -0
- data/pgpool2/sql/system_db.sql +38 -0
- data/pgpool2/strlcpy.c +85 -0
- data/pgpool2/test/C/test_extended.c +98 -0
- data/pgpool2/test/jdbc/.cvsignore +2 -0
- data/pgpool2/test/jdbc/AutoCommitTest.java +45 -0
- data/pgpool2/test/jdbc/BatchTest.java +55 -0
- data/pgpool2/test/jdbc/ColumnTest.java +60 -0
- data/pgpool2/test/jdbc/CreateTempTableTest.java +48 -0
- data/pgpool2/test/jdbc/InsertTest.java +34 -0
- data/pgpool2/test/jdbc/LockTest.java +36 -0
- data/pgpool2/test/jdbc/PgpoolTest.java +75 -0
- data/pgpool2/test/jdbc/README.euc_jp +73 -0
- data/pgpool2/test/jdbc/RunTest.java +83 -0
- data/pgpool2/test/jdbc/SelectTest.java +37 -0
- data/pgpool2/test/jdbc/UpdateTest.java +32 -0
- data/pgpool2/test/jdbc/expected/CreateTempTable +1 -0
- data/pgpool2/test/jdbc/expected/autocommit +10 -0
- data/pgpool2/test/jdbc/expected/batch +1 -0
- data/pgpool2/test/jdbc/expected/column +100 -0
- data/pgpool2/test/jdbc/expected/insert +1 -0
- data/pgpool2/test/jdbc/expected/lock +100 -0
- data/pgpool2/test/jdbc/expected/select +2 -0
- data/pgpool2/test/jdbc/expected/update +1 -0
- data/pgpool2/test/jdbc/pgpool.properties +7 -0
- data/pgpool2/test/jdbc/prepare.sql +54 -0
- data/pgpool2/test/jdbc/run.sh +6 -0
- data/pgpool2/test/parser/.cvsignore +6 -0
- data/pgpool2/test/parser/README +32 -0
- data/pgpool2/test/parser/expected/copy.out +17 -0
- data/pgpool2/test/parser/expected/create.out +64 -0
- data/pgpool2/test/parser/expected/cursor.out +37 -0
- data/pgpool2/test/parser/expected/delete.out +10 -0
- data/pgpool2/test/parser/expected/drop.out +12 -0
- data/pgpool2/test/parser/expected/insert.out +13 -0
- data/pgpool2/test/parser/expected/misc.out +28 -0
- data/pgpool2/test/parser/expected/prepare.out +4 -0
- data/pgpool2/test/parser/expected/privileges.out +31 -0
- data/pgpool2/test/parser/expected/scanner.out +30 -0
- data/pgpool2/test/parser/expected/select.out +89 -0
- data/pgpool2/test/parser/expected/transaction.out +38 -0
- data/pgpool2/test/parser/expected/update.out +11 -0
- data/pgpool2/test/parser/expected/v84.out +37 -0
- data/pgpool2/test/parser/expected/v90.out +25 -0
- data/pgpool2/test/parser/expected/var.out +22 -0
- data/pgpool2/test/parser/input/alter.sql +2 -0
- data/pgpool2/test/parser/input/copy.sql +17 -0
- data/pgpool2/test/parser/input/create.sql +64 -0
- data/pgpool2/test/parser/input/cursor.sql +37 -0
- data/pgpool2/test/parser/input/delete.sql +10 -0
- data/pgpool2/test/parser/input/drop.sql +12 -0
- data/pgpool2/test/parser/input/insert.sql +13 -0
- data/pgpool2/test/parser/input/misc.sql +28 -0
- data/pgpool2/test/parser/input/prepare.sql +4 -0
- data/pgpool2/test/parser/input/privileges.sql +31 -0
- data/pgpool2/test/parser/input/scanner.sql +34 -0
- data/pgpool2/test/parser/input/select.sql +89 -0
- data/pgpool2/test/parser/input/transaction.sql +38 -0
- data/pgpool2/test/parser/input/update.sql +11 -0
- data/pgpool2/test/parser/input/v84.sql +37 -0
- data/pgpool2/test/parser/input/v90.sql +38 -0
- data/pgpool2/test/parser/input/var.sql +22 -0
- data/pgpool2/test/parser/main.c +96 -0
- data/pgpool2/test/parser/parse_schedule +16 -0
- data/pgpool2/test/parser/pool.h +13 -0
- data/pgpool2/test/parser/run-test +62 -0
- data/pgpool2/test/pdo-test/README.euc_jp +58 -0
- data/pgpool2/test/pdo-test/SQLlist/test1.sql +3 -0
- data/pgpool2/test/pdo-test/SQLlist/test2.sql +3 -0
- data/pgpool2/test/pdo-test/collections.inc +11 -0
- data/pgpool2/test/pdo-test/def.inc +7 -0
- data/pgpool2/test/pdo-test/log.txt +0 -0
- data/pgpool2/test/pdo-test/mod/database.inc +36 -0
- data/pgpool2/test/pdo-test/mod/def.inc +0 -0
- data/pgpool2/test/pdo-test/mod/errorhandler.inc +27 -0
- data/pgpool2/test/pdo-test/pdotest.php +11 -0
- data/pgpool2/test/pdo-test/regsql.inc +56 -0
- data/pgpool2/test/pgpool_setup +898 -0
- data/pgpool2/test/regression/README +39 -0
- data/pgpool2/test/regression/clean.sh +21 -0
- data/pgpool2/test/regression/libs.sh +16 -0
- data/pgpool2/test/regression/regress.sh +166 -0
- data/pgpool2/test/regression/tests/001.load_balance/test.sh +128 -0
- data/pgpool2/test/regression/tests/002.native_replication/PgTester.java +47 -0
- data/pgpool2/test/regression/tests/002.native_replication/create.sql +6 -0
- data/pgpool2/test/regression/tests/002.native_replication/test.sh +71 -0
- data/pgpool2/test/regression/tests/003.failover/expected.r +6 -0
- data/pgpool2/test/regression/tests/003.failover/expected.s +6 -0
- data/pgpool2/test/regression/tests/003.failover/test.sh +45 -0
- data/pgpool2/test/regression/tests/004.watchdog/master.conf +12 -0
- data/pgpool2/test/regression/tests/004.watchdog/standby.conf +19 -0
- data/pgpool2/test/regression/tests/004.watchdog/test.sh +52 -0
- data/pgpool2/test/regression/tests/050.bug58/test.sh +50 -0
- data/pgpool2/test/regression/tests/051.bug60/bug.sql +12 -0
- data/pgpool2/test/regression/tests/051.bug60/database-clean.sql +6 -0
- data/pgpool2/test/regression/tests/051.bug60/database-setup.sql +28 -0
- data/pgpool2/test/regression/tests/051.bug60/test.sh +79 -0
- data/pgpool2/test/regression/tests/052.do_query/test.sh +44 -0
- data/pgpool2/test/regression/tests/053.insert_lock_hangs/test.sh +81 -0
- data/pgpool2/test/regression/tests/054.postgres_fdw/test.sh +67 -0
- data/pgpool2/test/regression/tests/055.backend_all_down/test.sh +52 -0
- data/pgpool2/test/regression/tests/056.bug63/jdbctest2.java +66 -0
- data/pgpool2/test/regression/tests/056.bug63/test.sh +47 -0
- data/pgpool2/test/regression/tests/057.bug61/test.sh +40 -0
- data/pgpool2/test/regression/tests/058.bug68/jdbctest3.java +45 -0
- data/pgpool2/test/regression/tests/058.bug68/test.sh +47 -0
- data/pgpool2/test/timestamp/expected/insert.out +16 -0
- data/pgpool2/test/timestamp/expected/misc.out +3 -0
- data/pgpool2/test/timestamp/expected/update.out +6 -0
- data/pgpool2/test/timestamp/input/insert.sql +16 -0
- data/pgpool2/test/timestamp/input/misc.sql +3 -0
- data/pgpool2/test/timestamp/input/update.sql +6 -0
- data/pgpool2/test/timestamp/main.c +129 -0
- data/pgpool2/test/timestamp/parse_schedule +3 -0
- data/pgpool2/test/timestamp/run-test +69 -0
- data/pgpool2/version.h +1 -0
- data/pgpool2/watchdog/Makefile.am +17 -0
- data/pgpool2/watchdog/Makefile.in +505 -0
- data/pgpool2/watchdog/test/stab.c +266 -0
- data/pgpool2/watchdog/test/test.c +85 -0
- data/pgpool2/watchdog/test/wd_child_t.c +87 -0
- data/pgpool2/watchdog/test/wd_lifecheck_t.c +87 -0
- data/pgpool2/watchdog/test/wd_packet_t.c +87 -0
- data/pgpool2/watchdog/test/wd_ping_t.c +20 -0
- data/pgpool2/watchdog/watchdog.c +408 -0
- data/pgpool2/watchdog/watchdog.h +209 -0
- data/pgpool2/watchdog/wd_child.c +444 -0
- data/pgpool2/watchdog/wd_ext.h +123 -0
- data/pgpool2/watchdog/wd_heartbeat.c +577 -0
- data/pgpool2/watchdog/wd_if.c +216 -0
- data/pgpool2/watchdog/wd_init.c +126 -0
- data/pgpool2/watchdog/wd_interlock.c +347 -0
- data/pgpool2/watchdog/wd_lifecheck.c +512 -0
- data/pgpool2/watchdog/wd_list.c +429 -0
- data/pgpool2/watchdog/wd_packet.c +1159 -0
- data/pgpool2/watchdog/wd_ping.c +330 -0
- data/pgpool2/ylwrap +223 -0
- data/pgsql/presto_client.py +346 -0
- data/pgsql/prestogres.py +156 -0
- data/pgsql/setup_functions.sql +21 -0
- data/pgsql/setup_language.sql +3 -0
- data/prestogres.gemspec +23 -0
- metadata +496 -0
data/pgpool2/pg_md5.c
ADDED
@@ -0,0 +1,305 @@
|
|
1
|
+
/* -*-pgsql-c-*- */
|
2
|
+
/*
|
3
|
+
* $Header$
|
4
|
+
*
|
5
|
+
* pgpool: a language independent connection pool server for PostgreSQL
|
6
|
+
* written by Tatsuo Ishii
|
7
|
+
*
|
8
|
+
* Copyright (c) 2003-2013 PgPool Global Development Group
|
9
|
+
*
|
10
|
+
* Permission to use, copy, modify, and distribute this software and
|
11
|
+
* its documentation for any purpose and without fee is hereby
|
12
|
+
* granted, provided that the above copyright notice appear in all
|
13
|
+
* copies and that both that copyright notice and this permission
|
14
|
+
* notice appear in supporting documentation, and that the name of the
|
15
|
+
* author not be used in advertising or publicity pertaining to
|
16
|
+
* distribution of the software without specific, written prior
|
17
|
+
* permission. The author makes no representations about the
|
18
|
+
* suitability of this software for any purpose. It is provided "as
|
19
|
+
* is" without express or implied warranty.
|
20
|
+
*
|
21
|
+
* pg_md5 command main
|
22
|
+
*
|
23
|
+
*/
|
24
|
+
#include "pool.h"
|
25
|
+
#include "pool_config.h"
|
26
|
+
#include "pool_passwd.h"
|
27
|
+
#include "md5.h"
|
28
|
+
|
29
|
+
#include <stdio.h>
|
30
|
+
#include <stdlib.h>
|
31
|
+
#include <string.h>
|
32
|
+
#include <unistd.h>
|
33
|
+
#include <errno.h>
|
34
|
+
#include <termios.h>
|
35
|
+
#ifdef HAVE_GETOPT_H
|
36
|
+
#include <getopt.h>
|
37
|
+
#else
|
38
|
+
#include "getopt_long.h"
|
39
|
+
#endif
|
40
|
+
#include <pwd.h>
|
41
|
+
#include <libgen.h>
|
42
|
+
|
43
|
+
/* Maximum number of characters allowed for input. */
|
44
|
+
#define MAX_INPUT_SIZE MAX_USER_NAME_LEN
|
45
|
+
|
46
|
+
static void print_usage(const char prog[], int exit_code);
|
47
|
+
static void set_tio_attr(int enable);
|
48
|
+
static void update_pool_passwd(char *conf_file, char *username, char *password);
|
49
|
+
|
50
|
+
int
|
51
|
+
main(int argc, char *argv[])
|
52
|
+
{
|
53
|
+
#define PRINT_USAGE(exit_code) print_usage(argv[0], exit_code)
|
54
|
+
|
55
|
+
char conf_file[POOLMAXPATHLEN+1];
|
56
|
+
char username[MAX_INPUT_SIZE+1];
|
57
|
+
int opt;
|
58
|
+
int optindex;
|
59
|
+
bool md5auth = false;
|
60
|
+
bool prompt = false;
|
61
|
+
|
62
|
+
static struct option long_options[] = {
|
63
|
+
{"help", no_argument, NULL, 'h'},
|
64
|
+
{"prompt", no_argument, NULL, 'p'},
|
65
|
+
{"md5auth", no_argument, NULL, 'm'},
|
66
|
+
{"username", required_argument, NULL, 'u'},
|
67
|
+
{"config-file", required_argument, NULL, 'f'},
|
68
|
+
{NULL, 0, NULL, 0}
|
69
|
+
};
|
70
|
+
|
71
|
+
snprintf(conf_file, sizeof(conf_file), "%s/%s", DEFAULT_CONFIGDIR, POOL_CONF_FILE_NAME);
|
72
|
+
|
73
|
+
/* initialize username buffer with zeros so that we can use strlen on it later
|
74
|
+
to check if a username was given on the command line
|
75
|
+
*/
|
76
|
+
memset(username, 0, MAX_INPUT_SIZE+1);
|
77
|
+
|
78
|
+
while ((opt = getopt_long(argc, argv, "hpmf:u:", long_options, &optindex)) != -1)
|
79
|
+
{
|
80
|
+
switch (opt)
|
81
|
+
{
|
82
|
+
case 'p': /* prompt for password */
|
83
|
+
prompt = true;
|
84
|
+
break;
|
85
|
+
|
86
|
+
case 'm': /* produce md5 authentication password */
|
87
|
+
md5auth = true;
|
88
|
+
break;
|
89
|
+
|
90
|
+
case 'f': /* specify configuration file */
|
91
|
+
if (!optarg)
|
92
|
+
{
|
93
|
+
PRINT_USAGE(EXIT_SUCCESS);
|
94
|
+
}
|
95
|
+
strlcpy(conf_file, optarg, sizeof(conf_file));
|
96
|
+
break;
|
97
|
+
|
98
|
+
case 'u':
|
99
|
+
if (!optarg)
|
100
|
+
{
|
101
|
+
PRINT_USAGE(EXIT_SUCCESS);
|
102
|
+
}
|
103
|
+
/* check the input limit early */
|
104
|
+
if (strlen(optarg) > MAX_INPUT_SIZE)
|
105
|
+
{
|
106
|
+
fprintf(stderr, "Error: input exceeds maximum username length!\n\n");
|
107
|
+
exit(EXIT_FAILURE);
|
108
|
+
}
|
109
|
+
strlcpy(username, optarg, sizeof(username));
|
110
|
+
break;
|
111
|
+
|
112
|
+
default:
|
113
|
+
PRINT_USAGE(EXIT_SUCCESS);
|
114
|
+
break;
|
115
|
+
}
|
116
|
+
}
|
117
|
+
|
118
|
+
/* Prompt for password. */
|
119
|
+
if (prompt)
|
120
|
+
{
|
121
|
+
char md5[MD5_PASSWD_LEN+1];
|
122
|
+
char buf[MAX_INPUT_SIZE+1];
|
123
|
+
int len;
|
124
|
+
|
125
|
+
set_tio_attr(1);
|
126
|
+
printf("password: ");
|
127
|
+
if (!fgets(buf, (MAX_INPUT_SIZE+1), stdin))
|
128
|
+
{
|
129
|
+
int eno = errno;
|
130
|
+
|
131
|
+
fprintf(stderr, "Couldn't read input from stdin. (fgets(): %s)",
|
132
|
+
strerror(eno));
|
133
|
+
|
134
|
+
exit(EXIT_FAILURE);
|
135
|
+
}
|
136
|
+
printf("\n");
|
137
|
+
set_tio_attr(0);
|
138
|
+
|
139
|
+
/* Remove LF at the end of line, if there is any. */
|
140
|
+
len = strlen(buf);
|
141
|
+
if (len > 0 && buf[len-1] == '\n')
|
142
|
+
{
|
143
|
+
buf[len-1] = '\0';
|
144
|
+
len--;
|
145
|
+
}
|
146
|
+
|
147
|
+
if (md5auth)
|
148
|
+
{
|
149
|
+
update_pool_passwd(conf_file, username, buf);
|
150
|
+
}
|
151
|
+
else
|
152
|
+
{
|
153
|
+
pool_md5_hash(buf, len, md5);
|
154
|
+
printf("%s\n", md5);
|
155
|
+
}
|
156
|
+
}
|
157
|
+
|
158
|
+
/* Read password from argv. */
|
159
|
+
else
|
160
|
+
{
|
161
|
+
char md5[POOL_PASSWD_LEN+1];
|
162
|
+
int len;
|
163
|
+
|
164
|
+
if (optind >= argc)
|
165
|
+
{
|
166
|
+
PRINT_USAGE(EXIT_FAILURE);
|
167
|
+
}
|
168
|
+
|
169
|
+
len = strlen(argv[optind]);
|
170
|
+
|
171
|
+
if (len > MAX_INPUT_SIZE)
|
172
|
+
{
|
173
|
+
fprintf(stderr, "Error: Input exceeds maximum password length!\n\n");
|
174
|
+
PRINT_USAGE(EXIT_FAILURE);
|
175
|
+
}
|
176
|
+
|
177
|
+
if (md5auth)
|
178
|
+
{
|
179
|
+
update_pool_passwd(conf_file, username, argv[optind]);
|
180
|
+
}
|
181
|
+
else
|
182
|
+
{
|
183
|
+
pool_md5_hash(argv[optind], len, md5);
|
184
|
+
printf("%s\n", md5);
|
185
|
+
}
|
186
|
+
}
|
187
|
+
|
188
|
+
return EXIT_SUCCESS;
|
189
|
+
}
|
190
|
+
|
191
|
+
static void update_pool_passwd(char *conf_file, char *username, char *password)
|
192
|
+
{
|
193
|
+
struct passwd *pw;
|
194
|
+
char md5[POOL_PASSWD_LEN+1];
|
195
|
+
char pool_passwd[POOLMAXPATHLEN+1];
|
196
|
+
char dirnamebuf[POOLMAXPATHLEN+1];
|
197
|
+
char *dirp;
|
198
|
+
|
199
|
+
if (pool_init_config())
|
200
|
+
{
|
201
|
+
fprintf(stderr, "pool_init_config() failed\n\n");
|
202
|
+
exit(EXIT_FAILURE);
|
203
|
+
}
|
204
|
+
if (pool_get_config(conf_file, INIT_CONFIG))
|
205
|
+
{
|
206
|
+
fprintf(stderr, "Unable to get configuration. Exiting...");
|
207
|
+
exit(EXIT_FAILURE);
|
208
|
+
}
|
209
|
+
|
210
|
+
strlcpy(dirnamebuf, conf_file, sizeof(dirnamebuf));
|
211
|
+
dirp = dirname(dirnamebuf);
|
212
|
+
snprintf(pool_passwd, sizeof(pool_passwd), "%s/%s",
|
213
|
+
dirp, pool_config->pool_passwd);
|
214
|
+
pool_init_pool_passwd(pool_passwd);
|
215
|
+
|
216
|
+
if (strlen(username))
|
217
|
+
{
|
218
|
+
/* generate the hash for the given username */
|
219
|
+
pg_md5_encrypt(password, username, strlen(username), md5);
|
220
|
+
pool_create_passwdent(username, md5);
|
221
|
+
}
|
222
|
+
else
|
223
|
+
{
|
224
|
+
/* get the user information from the current uid */
|
225
|
+
pw = getpwuid(getuid());
|
226
|
+
if (!pw)
|
227
|
+
{
|
228
|
+
fprintf(stderr, "getpwuid() failed\n\n");
|
229
|
+
exit(EXIT_FAILURE);
|
230
|
+
}
|
231
|
+
pg_md5_encrypt(password, pw->pw_name, strlen(pw->pw_name), md5);
|
232
|
+
pool_create_passwdent(pw->pw_name, md5);
|
233
|
+
}
|
234
|
+
pool_finish_pool_passwd();
|
235
|
+
}
|
236
|
+
|
237
|
+
static void
|
238
|
+
print_usage(const char prog[], int exit_code)
|
239
|
+
{
|
240
|
+
fprintf(((exit_code == EXIT_SUCCESS) ? stdout : stderr),
|
241
|
+
"Usage:\n\
|
242
|
+
\n\
|
243
|
+
%s [OPTIONS]\n\
|
244
|
+
%s <PASSWORD>\n\
|
245
|
+
\n\
|
246
|
+
--prompt, -p Prompt password using standard input.\n\
|
247
|
+
--md5auth, -m Produce md5 authentication password.\n\
|
248
|
+
--username, -u USER When producing a md5 authentication password,\n\
|
249
|
+
create the pool_passwd entry for USER.\n\
|
250
|
+
--config-file, -f CONFIG-FILE Specify pgpool.conf.\n\
|
251
|
+
--help, -h This help menu.\n\
|
252
|
+
\n\
|
253
|
+
Warning: At most %d characters are allowed for input.\n\
|
254
|
+
Warning: Plain password argument is deprecated for security concerns\n\
|
255
|
+
and kept for compatibility. Please prefer using password\n\
|
256
|
+
prompt.\n",
|
257
|
+
prog, prog, MAX_INPUT_SIZE);
|
258
|
+
|
259
|
+
exit(exit_code);
|
260
|
+
}
|
261
|
+
|
262
|
+
|
263
|
+
static void
|
264
|
+
set_tio_attr(int set)
|
265
|
+
{
|
266
|
+
struct termios tio;
|
267
|
+
static struct termios tio_save;
|
268
|
+
|
269
|
+
|
270
|
+
if (!isatty(0))
|
271
|
+
{
|
272
|
+
fprintf(stderr, "stdin is not tty\n");
|
273
|
+
exit(EXIT_FAILURE);
|
274
|
+
}
|
275
|
+
|
276
|
+
if (set)
|
277
|
+
{
|
278
|
+
if (tcgetattr(0, &tio) < 0)
|
279
|
+
{
|
280
|
+
fprintf(stderr, "set_tio_attr(set): tcgetattr failed\n");
|
281
|
+
exit(EXIT_FAILURE);
|
282
|
+
}
|
283
|
+
|
284
|
+
tio_save = tio;
|
285
|
+
|
286
|
+
tio.c_iflag &= ~(BRKINT|ISTRIP|IXON);
|
287
|
+
tio.c_lflag &= ~(ICANON|IEXTEN|ECHO|ECHOE|ECHOK|ECHONL);
|
288
|
+
tio.c_cc[VMIN] = 1;
|
289
|
+
tio.c_cc[VTIME] = 0;
|
290
|
+
|
291
|
+
if (tcsetattr(0, TCSANOW, &tio) < 0)
|
292
|
+
{
|
293
|
+
fprintf(stderr, "(set_tio_attr(set): tcsetattr failed\n");
|
294
|
+
exit(EXIT_FAILURE);
|
295
|
+
}
|
296
|
+
}
|
297
|
+
else
|
298
|
+
{
|
299
|
+
if (tcsetattr(0, TCSANOW, &tio_save) < 0)
|
300
|
+
{
|
301
|
+
fprintf(stderr, "set_tio_attr(reset): tcsetattr failed\n");
|
302
|
+
exit(EXIT_FAILURE);
|
303
|
+
}
|
304
|
+
}
|
305
|
+
}
|
data/pgpool2/pgpool.8.in
ADDED
@@ -0,0 +1,121 @@
|
|
1
|
+
.\" Copyright 2004-2009 by PgPool Global Development Group
|
2
|
+
.\" This man page is subject to the same license as the rest of pgpool.
|
3
|
+
.\"
|
4
|
+
.TH PGPOOL 8 "12 Oct 2009"
|
5
|
+
.\" Please adjust this date whenever revising the manpage.
|
6
|
+
.hy 0
|
7
|
+
.ad l
|
8
|
+
.nf
|
9
|
+
.SH NAME
|
10
|
+
pgpool \- PostgreSQL connection pool daemon
|
11
|
+
.SH SYNOPSIS
|
12
|
+
\fBpgpool\fR [ \fB\-c\fR] [ \fB\-f config_file\fR ] [ \fB\-F pcp_config_file\fR ] [ \fB\-a hba_file\fR ] [ \fB\-n\fR ] [ \fB\-D\fR ] [ \fB\-d\fR ]
|
13
|
+
.LP
|
14
|
+
\fBpgpool\fR [ \fB\-f config_file\fR ] [ \fB\-F pcp_config_file\fR ] [ \fB\-a hba_file\fR ] [ \fB\-m\fR \fI{s[mart]|f[ast]|i[mmediate]}\fR ] \fBstop\fR
|
15
|
+
.LP
|
16
|
+
\fBpgpool\fR [ \fB\-f config_file\fR ] [ \fB\-F pcp_config_file\fR ] [ \fB\-a hba_file\fR ] \fBreload\fR
|
17
|
+
.LP
|
18
|
+
.SH DESCRIPTION
|
19
|
+
\fBpgpool\fR is a connection pool server for PostgreSQL.
|
20
|
+
\fBpgpool\fR runs between PostgreSQL's client and server.
|
21
|
+
Any PostgreSQL client can connect to \fBpgpool\fR as if it's a real PostgreSQL server.
|
22
|
+
\fBpgpool\fR caches the connection to the PostgreSQL server to reduce the overhead
|
23
|
+
involved in establishing the connection to it.
|
24
|
+
.P
|
25
|
+
\fBpgpool\fR can also be
|
26
|
+
used with two PostgreSQL servers for fail over purposes. If the first
|
27
|
+
server goes down, \fBpgpool\fR will automatically switch to the secondary server.
|
28
|
+
.P
|
29
|
+
\fBpgpool\fR is typically started and stopped via system initialization scripts.
|
30
|
+
.
|
31
|
+
.P
|
32
|
+
.SH INVOCATION
|
33
|
+
.TP
|
34
|
+
\fBpgpool\fP [ \fIoptions...\fP ]
|
35
|
+
Starts as a daemon in the background (unless \fB\-n\fR is given).
|
36
|
+
.TP
|
37
|
+
\fBpgpool\fP [ \fIoptions...\fP ] \fBstop\fP
|
38
|
+
Shutdown.
|
39
|
+
.TP
|
40
|
+
\fBpgpool\fP [ \fIoptions...\fP ] \fBreload\fP
|
41
|
+
Reloads the configuration.
|
42
|
+
.
|
43
|
+
.SH OPTIONS
|
44
|
+
.TP
|
45
|
+
\fB\-a\fR \fIpath\fR
|
46
|
+
.P
|
47
|
+
.B \--hba-file\fR \fIpath\fR
|
48
|
+
Sets the path to the \fIpool_hba.conf\fR configuration file (default: \fI@sysconfdir@/pgpool_hba.conf\fR).
|
49
|
+
.TP
|
50
|
+
\fB\-c\fR
|
51
|
+
.P
|
52
|
+
.B \--clear-cache
|
53
|
+
Clears the query cache.
|
54
|
+
.TP
|
55
|
+
\fB\-d\fR
|
56
|
+
.P
|
57
|
+
.B \--debug
|
58
|
+
Print lots of debug messages.
|
59
|
+
.TP
|
60
|
+
\fB\-f\fR \fIpath\fR
|
61
|
+
.P
|
62
|
+
.B \--config-file\fR \fIpath\fR
|
63
|
+
Sets the path to the \fIpgpool.conf\fR configuration file (default: \fI@sysconfdir@/pgpool.conf\fR).
|
64
|
+
.TP
|
65
|
+
\fB\-F\fR \fIpath\fR
|
66
|
+
.P
|
67
|
+
.B \--pcp-config-file\fR \fIpath\fR
|
68
|
+
Sets the path to the \fIpcp.conf\fR configuration file (default: \fI@sysconfdir@/pcp.conf\fR).
|
69
|
+
.TP
|
70
|
+
\fB\-h\fR
|
71
|
+
.P
|
72
|
+
.B \--help
|
73
|
+
Print a help message and exit.
|
74
|
+
.TP
|
75
|
+
\fB\-m\fR \fImode\fR
|
76
|
+
.P
|
77
|
+
.B \--mode\fR \fImode\fR
|
78
|
+
Shutdown mode:
|
79
|
+
.B smart, fast,
|
80
|
+
or
|
81
|
+
.BR immediate .
|
82
|
+
.TP
|
83
|
+
\fB\-n\fR
|
84
|
+
.P
|
85
|
+
.B \--no-daemon
|
86
|
+
Foreground mode.
|
87
|
+
Error messages go to stdout or stderr, which
|
88
|
+
could be piped out to log processors such as
|
89
|
+
.BR logger (1)
|
90
|
+
or
|
91
|
+
.BR rotatelogs (8).
|
92
|
+
To daemonize, explicitly invoke
|
93
|
+
.B pgpool
|
94
|
+
in background.
|
95
|
+
.TP
|
96
|
+
.B \-D
|
97
|
+
.P
|
98
|
+
.B \--discard-status
|
99
|
+
Discard pgpool_status file and do not restore previous status.
|
100
|
+
.TP
|
101
|
+
.B \-v
|
102
|
+
.P
|
103
|
+
.B \--version
|
104
|
+
Print version and exit.
|
105
|
+
.
|
106
|
+
.SH FILES
|
107
|
+
.TP
|
108
|
+
\fI@sysconfdir@/pgpool.conf\fR
|
109
|
+
Default configuration file
|
110
|
+
.TP
|
111
|
+
\fI@sysconfdir@/pool_hba.conf\fR
|
112
|
+
Host Based Access configuration file
|
113
|
+
.TP
|
114
|
+
\fI@sysconfdir@/pcp.conf\fR
|
115
|
+
PCP commands configuration file
|
116
|
+
.SH SEE ALSO
|
117
|
+
.BR logger (1),
|
118
|
+
.BR postmaster (1),
|
119
|
+
.BR rotatelogs (8)
|
120
|
+
.PP
|
121
|
+
Additional information can be found in the \fBpgpool\fR \fIREADME\fR file.
|
data/pgpool2/pgpool.conf
ADDED
@@ -0,0 +1,553 @@
|
|
1
|
+
# ----------------------------
|
2
|
+
# pgPool-II configuration file
|
3
|
+
# ----------------------------
|
4
|
+
#
|
5
|
+
# This file consists of lines of the form:
|
6
|
+
#
|
7
|
+
# name = value
|
8
|
+
#
|
9
|
+
# Whitespace may be used. Comments are introduced with "#" anywhere on a line.
|
10
|
+
# The complete list of parameter names and allowed values can be found in the
|
11
|
+
# pgPool-II documentation.
|
12
|
+
#
|
13
|
+
# This file is read on server startup and when the server receives a SIGHUP
|
14
|
+
# signal. If you edit the file on a running system, you have to SIGHUP the
|
15
|
+
# server for the changes to take effect, or use "pgpool reload". Some
|
16
|
+
# parameters, which are marked below, require a server shutdown and restart to
|
17
|
+
# take effect.
|
18
|
+
#
|
19
|
+
|
20
|
+
|
21
|
+
#------------------------------------------------------------------------------
|
22
|
+
# CONNECTIONS
|
23
|
+
#------------------------------------------------------------------------------
|
24
|
+
|
25
|
+
# - pgpool Connection Settings -
|
26
|
+
|
27
|
+
listen_addresses = '*'
|
28
|
+
# Host name or IP address to listen on:
|
29
|
+
# '*' for all, '' for no TCP/IP connections
|
30
|
+
# (change requires restart)
|
31
|
+
port = 9999
|
32
|
+
# Port number
|
33
|
+
# (change requires restart)
|
34
|
+
socket_dir = '/tmp'
|
35
|
+
# Unix domain socket path
|
36
|
+
# The Debian package defaults to
|
37
|
+
# /var/run/postgresql
|
38
|
+
# (change requires restart)
|
39
|
+
|
40
|
+
|
41
|
+
# - pgpool Communication Manager Connection Settings -
|
42
|
+
|
43
|
+
pcp_port = 9898
|
44
|
+
# Port number for pcp
|
45
|
+
# (change requires restart)
|
46
|
+
pcp_socket_dir = '/tmp'
|
47
|
+
# Unix domain socket path for pcp
|
48
|
+
# The Debian package defaults to
|
49
|
+
# /var/run/postgresql
|
50
|
+
# (change requires restart)
|
51
|
+
|
52
|
+
# - Backend Connection Settings -
|
53
|
+
|
54
|
+
backend_hostname0 = 'vm1'
|
55
|
+
# Host name or IP address to connect to for backend 0
|
56
|
+
backend_port0 = 5432
|
57
|
+
# Port number for backend 0
|
58
|
+
backend_weight0 = 1
|
59
|
+
# Weight for backend 0 (only in load balancing mode)
|
60
|
+
backend_data_directory0 = '/usr/local/pgsql/data'
|
61
|
+
# Data directory for backend 0
|
62
|
+
backend_flag0 = 'ALLOW_TO_FAILOVER'
|
63
|
+
# Controls various backend behavior
|
64
|
+
# ALLOW_TO_FAILOVER or DISALLOW_TO_FAILOVER
|
65
|
+
backend_hostname1 = 'vm2'
|
66
|
+
backend_port1 = 5433
|
67
|
+
backend_weight1 = 1
|
68
|
+
backend_data_directory1 = '/usr/local/pgsql/data'
|
69
|
+
backend_flag1 = 'ALLOW_TO_FAILOVER'
|
70
|
+
|
71
|
+
# - Authentication -
|
72
|
+
|
73
|
+
enable_pool_hba = off
|
74
|
+
# Use pool_hba.conf for client authentication
|
75
|
+
authentication_timeout = 60
|
76
|
+
# Delay in seconds to complete client authentication
|
77
|
+
# 0 means no timeout.
|
78
|
+
|
79
|
+
# - SSL Connections -
|
80
|
+
|
81
|
+
ssl = off
|
82
|
+
# Enable SSL support
|
83
|
+
# (change requires restart)
|
84
|
+
#ssl_key = './server.key'
|
85
|
+
# Path to the SSL private key file
|
86
|
+
# (change requires restart)
|
87
|
+
#ssl_cert = './server.cert'
|
88
|
+
# Path to the SSL public certificate file
|
89
|
+
# (change requires restart)
|
90
|
+
#ssl_ca_cert = ''
|
91
|
+
# Path to a single PEM format file
|
92
|
+
# containing CA root certificate(s)
|
93
|
+
# (change requires restart)
|
94
|
+
#ssl_ca_cert_dir = ''
|
95
|
+
# Directory containing CA root certificate(s)
|
96
|
+
# (change requires restart)
|
97
|
+
|
98
|
+
|
99
|
+
#------------------------------------------------------------------------------
|
100
|
+
# POOLS
|
101
|
+
#------------------------------------------------------------------------------
|
102
|
+
|
103
|
+
# - Pool size -
|
104
|
+
|
105
|
+
num_init_children = 32
|
106
|
+
# Number of pools
|
107
|
+
# (change requires restart)
|
108
|
+
max_pool = 4
|
109
|
+
# Number of connections per pool
|
110
|
+
# (change requires restart)
|
111
|
+
|
112
|
+
# - Life time -
|
113
|
+
|
114
|
+
child_life_time = 300
|
115
|
+
# Pool exits after being idle for this many seconds
|
116
|
+
child_max_connections = 0
|
117
|
+
# Pool exits after receiving that many connections
|
118
|
+
# 0 means no exit
|
119
|
+
connection_life_time = 0
|
120
|
+
# Connection to backend closes after being idle for this many seconds
|
121
|
+
# 0 means no close
|
122
|
+
client_idle_limit = 0
|
123
|
+
# Client is disconnected after being idle for that many seconds
|
124
|
+
# (even inside an explicit transactions!)
|
125
|
+
# 0 means no disconnection
|
126
|
+
|
127
|
+
|
128
|
+
#------------------------------------------------------------------------------
|
129
|
+
# LOGS
|
130
|
+
#------------------------------------------------------------------------------
|
131
|
+
|
132
|
+
# - Where to log -
|
133
|
+
|
134
|
+
log_destination = 'stderr'
|
135
|
+
# Where to log
|
136
|
+
# Valid values are combinations of stderr,
|
137
|
+
# and syslog. Default to stderr.
|
138
|
+
|
139
|
+
# - What to log -
|
140
|
+
|
141
|
+
print_timestamp = on
|
142
|
+
# Print timestamp on each line
|
143
|
+
# (change requires restart)
|
144
|
+
|
145
|
+
log_connections = off
|
146
|
+
# Log connections
|
147
|
+
log_hostname = off
|
148
|
+
# Hostname will be shown in ps status
|
149
|
+
# and in logs if connections are logged
|
150
|
+
log_statement = off
|
151
|
+
# Log all statements
|
152
|
+
log_per_node_statement = off
|
153
|
+
# Log all statements
|
154
|
+
# with node and backend informations
|
155
|
+
log_standby_delay = 'none'
|
156
|
+
# Log standby delay
|
157
|
+
# Valid values are combinations of always,
|
158
|
+
# if_over_threshold, none
|
159
|
+
|
160
|
+
# - Syslog specific -
|
161
|
+
|
162
|
+
syslog_facility = 'LOCAL0'
|
163
|
+
# Syslog local facility. Default to LOCAL0
|
164
|
+
syslog_ident = 'pgpool'
|
165
|
+
# Syslog program identification string
|
166
|
+
# Default to 'pgpool'
|
167
|
+
|
168
|
+
# - Debug -
|
169
|
+
|
170
|
+
debug_level = 0
|
171
|
+
# Debug message verbosity level
|
172
|
+
# 0 means no message, 1 or more mean verbose
|
173
|
+
|
174
|
+
|
175
|
+
#------------------------------------------------------------------------------
|
176
|
+
# FILE LOCATIONS
|
177
|
+
#------------------------------------------------------------------------------
|
178
|
+
|
179
|
+
pid_file_name = './pgpool.pid'
|
180
|
+
# PID file name
|
181
|
+
# (change requires restart)
|
182
|
+
logdir = '/tmp'
|
183
|
+
# Directory of pgPool status file
|
184
|
+
# (change requires restart)
|
185
|
+
|
186
|
+
|
187
|
+
#------------------------------------------------------------------------------
|
188
|
+
# CONNECTION POOLING
|
189
|
+
#------------------------------------------------------------------------------
|
190
|
+
|
191
|
+
connection_cache = on
|
192
|
+
# Activate connection pools
|
193
|
+
# (change requires restart)
|
194
|
+
|
195
|
+
# Semicolon separated list of queries
|
196
|
+
# to be issued at the end of a session
|
197
|
+
# The default is for 8.3 and later
|
198
|
+
reset_query_list = 'ABORT; DISCARD ALL'
|
199
|
+
# The following one is for 8.2 and before
|
200
|
+
#reset_query_list = 'ABORT; RESET ALL; SET SESSION AUTHORIZATION DEFAULT'
|
201
|
+
|
202
|
+
|
203
|
+
#------------------------------------------------------------------------------
|
204
|
+
# REPLICATION MODE
|
205
|
+
#------------------------------------------------------------------------------
|
206
|
+
|
207
|
+
replication_mode = off
|
208
|
+
# Activate replication mode
|
209
|
+
# (change requires restart)
|
210
|
+
replicate_select = off
|
211
|
+
# Replicate SELECT statements
|
212
|
+
# when in replication or parallel mode
|
213
|
+
# replicate_select is higher priority than
|
214
|
+
# load_balance_mode.
|
215
|
+
|
216
|
+
insert_lock = on
|
217
|
+
# Automatically locks a dummy row or a table
|
218
|
+
# with INSERT statements to keep SERIAL data
|
219
|
+
# consistency
|
220
|
+
# Without SERIAL, no lock will be issued
|
221
|
+
lobj_lock_table = ''
|
222
|
+
# When rewriting lo_creat command in
|
223
|
+
# replication mode, specify table name to
|
224
|
+
# lock
|
225
|
+
|
226
|
+
# - Degenerate handling -
|
227
|
+
|
228
|
+
replication_stop_on_mismatch = off
|
229
|
+
# On disagreement with the packet kind
|
230
|
+
# sent from backend, degenerate the node
|
231
|
+
# which is most likely "minority"
|
232
|
+
# If off, just force to exit this session
|
233
|
+
|
234
|
+
failover_if_affected_tuples_mismatch = off
|
235
|
+
# On disagreement with the number of affected
|
236
|
+
# tuples in UPDATE/DELETE queries, then
|
237
|
+
# degenerate the node which is most likely
|
238
|
+
# "minority".
|
239
|
+
# If off, just abort the transaction to
|
240
|
+
# keep the consistency
|
241
|
+
|
242
|
+
|
243
|
+
#------------------------------------------------------------------------------
|
244
|
+
# LOAD BALANCING MODE
|
245
|
+
#------------------------------------------------------------------------------
|
246
|
+
|
247
|
+
load_balance_mode = off
|
248
|
+
# Activate load balancing mode
|
249
|
+
# (change requires restart)
|
250
|
+
ignore_leading_white_space = on
|
251
|
+
# Ignore leading white spaces of each query
|
252
|
+
white_function_list = ''
|
253
|
+
# Comma separated list of function names
|
254
|
+
# that don't write to database
|
255
|
+
# Regexp are accepted
|
256
|
+
black_function_list = 'nextval,setval'
|
257
|
+
# Comma separated list of function names
|
258
|
+
# that write to database
|
259
|
+
# Regexp are accepted
|
260
|
+
|
261
|
+
|
262
|
+
#------------------------------------------------------------------------------
|
263
|
+
# MASTER/SLAVE MODE
|
264
|
+
#------------------------------------------------------------------------------
|
265
|
+
|
266
|
+
master_slave_mode = off
|
267
|
+
# Activate master/slave mode
|
268
|
+
# (change requires restart)
|
269
|
+
master_slave_sub_mode = 'slony'
|
270
|
+
# Master/slave sub mode
|
271
|
+
# Valid values are combinations slony or
|
272
|
+
# stream. Default is slony.
|
273
|
+
# (change requires restart)
|
274
|
+
|
275
|
+
# - Streaming -
|
276
|
+
|
277
|
+
sr_check_period = 0
|
278
|
+
# Streaming replication check period
|
279
|
+
# Disabled (0) by default
|
280
|
+
sr_check_user = 'nobody'
|
281
|
+
# Streaming replication check user
|
282
|
+
# This is necessary even if you disable
|
283
|
+
# streaming replication delay check with
|
284
|
+
# sr_check_period = 0
|
285
|
+
sr_check_password = ''
|
286
|
+
# Password for streaming replication check user
|
287
|
+
delay_threshold = 0
|
288
|
+
# Threshold before not dispatching query to standby node
|
289
|
+
# Unit is in bytes
|
290
|
+
# Disabled (0) by default
|
291
|
+
|
292
|
+
# - Special commands -
|
293
|
+
|
294
|
+
follow_master_command = ''
|
295
|
+
# Executes this command after master failover
|
296
|
+
# Special values:
|
297
|
+
# %d = node id
|
298
|
+
# %h = host name
|
299
|
+
# %p = port number
|
300
|
+
# %D = database cluster path
|
301
|
+
# %m = new master node id
|
302
|
+
# %H = hostname of the new master node
|
303
|
+
# %M = old master node id
|
304
|
+
# %P = old primary node id
|
305
|
+
# %r = new master port number
|
306
|
+
# %R = new master database cluster path
|
307
|
+
# %% = '%' character
|
308
|
+
|
309
|
+
|
310
|
+
#------------------------------------------------------------------------------
|
311
|
+
# PARALLEL MODE
|
312
|
+
#------------------------------------------------------------------------------
|
313
|
+
|
314
|
+
parallel_mode = off
|
315
|
+
# Activates parallel query mode
|
316
|
+
# (change requires restart)
|
317
|
+
pgpool2_hostname = 'vm1'
|
318
|
+
# Set pgpool2 hostname
|
319
|
+
# (change requires restart)
|
320
|
+
|
321
|
+
# - System DB info -
|
322
|
+
|
323
|
+
system_db_hostname = 'localhost'
|
324
|
+
# (change requires restart)
|
325
|
+
system_db_port = 5432
|
326
|
+
# (change requires restart)
|
327
|
+
system_db_dbname = 'pgpool'
|
328
|
+
# (change requires restart)
|
329
|
+
system_db_schema = 'pgpool_catalog'
|
330
|
+
# (change requires restart)
|
331
|
+
system_db_user = 'pgpool'
|
332
|
+
# (change requires restart)
|
333
|
+
system_db_password = ''
|
334
|
+
# (change requires restart)
|
335
|
+
|
336
|
+
|
337
|
+
#------------------------------------------------------------------------------
|
338
|
+
# HEALTH CHECK
|
339
|
+
#------------------------------------------------------------------------------
|
340
|
+
|
341
|
+
health_check_period = 0
|
342
|
+
# Health check period
|
343
|
+
# Disabled (0) by default
|
344
|
+
health_check_timeout = 20
|
345
|
+
# Health check timeout
|
346
|
+
# 0 means no timeout
|
347
|
+
health_check_user = 'nobody'
|
348
|
+
# Health check user
|
349
|
+
health_check_password = ''
|
350
|
+
# Password for health check user
|
351
|
+
health_check_max_retries = 0
|
352
|
+
# Maximum number of times to retry a failed health check before giving up.
|
353
|
+
health_check_retry_delay = 1
|
354
|
+
# Amount of time to wait (in seconds) between retries.
|
355
|
+
|
356
|
+
|
357
|
+
#------------------------------------------------------------------------------
|
358
|
+
# FAILOVER AND FAILBACK
|
359
|
+
#------------------------------------------------------------------------------
|
360
|
+
|
361
|
+
failover_command = ''
|
362
|
+
# Executes this command at failover
|
363
|
+
# Special values:
|
364
|
+
# %d = node id
|
365
|
+
# %h = host name
|
366
|
+
# %p = port number
|
367
|
+
# %D = database cluster path
|
368
|
+
# %m = new master node id
|
369
|
+
# %H = hostname of the new master node
|
370
|
+
# %M = old master node id
|
371
|
+
# %P = old primary node id
|
372
|
+
# %r = new master port number
|
373
|
+
# %R = new master database cluster path
|
374
|
+
# %% = '%' character
|
375
|
+
failback_command = ''
|
376
|
+
# Executes this command at failback.
|
377
|
+
# Special values:
|
378
|
+
# %d = node id
|
379
|
+
# %h = host name
|
380
|
+
# %p = port number
|
381
|
+
# %D = database cluster path
|
382
|
+
# %m = new master node id
|
383
|
+
# %H = hostname of the new master node
|
384
|
+
# %M = old master node id
|
385
|
+
# %P = old primary node id
|
386
|
+
# %r = new master port number
|
387
|
+
# %R = new master database cluster path
|
388
|
+
# %% = '%' character
|
389
|
+
|
390
|
+
fail_over_on_backend_error = on
|
391
|
+
# Initiates failover when reading/writing to the
|
392
|
+
# backend communication socket fails
|
393
|
+
# If set to off, pgpool will report an
|
394
|
+
# error and disconnect the session.
|
395
|
+
|
396
|
+
search_primary_node_timeout = 10
|
397
|
+
# Timeout in seconds to search for the
|
398
|
+
# primary node when a failover occurs.
|
399
|
+
# 0 means no timeout, keep searching
|
400
|
+
# for a primary node forever.
|
401
|
+
|
402
|
+
#------------------------------------------------------------------------------
|
403
|
+
# ONLINE RECOVERY
|
404
|
+
#------------------------------------------------------------------------------
|
405
|
+
|
406
|
+
recovery_user = 'nobody'
|
407
|
+
# Online recovery user
|
408
|
+
recovery_password = ''
|
409
|
+
# Online recovery password
|
410
|
+
recovery_1st_stage_command = ''
|
411
|
+
# Executes a command in first stage
|
412
|
+
recovery_2nd_stage_command = ''
|
413
|
+
# Executes a command in second stage
|
414
|
+
recovery_timeout = 90
|
415
|
+
# Timeout in seconds to wait for the
|
416
|
+
# recovering node's postmaster to start up
|
417
|
+
# 0 means no wait
|
418
|
+
client_idle_limit_in_recovery = 0
|
419
|
+
# Client is disconnected after being idle
|
420
|
+
# for that many seconds in the second stage
|
421
|
+
# of online recovery
|
422
|
+
# 0 means no disconnection
|
423
|
+
# -1 means immediate disconnection
|
424
|
+
|
425
|
+
|
426
|
+
#------------------------------------------------------------------------------
|
427
|
+
# WATCHDOG
|
428
|
+
#------------------------------------------------------------------------------
|
429
|
+
use_watchdog = on
|
430
|
+
# Activates watchdog
|
431
|
+
trusted_servers = '192.168.122.1'
|
432
|
+
# trusted server list which are used
|
433
|
+
# to confirm network connection
|
434
|
+
# (hostA,hostB,hostC,...)
|
435
|
+
delegate_IP = '192.168.122.80'
|
436
|
+
# delegate IP address
|
437
|
+
wd_hostname = 'vm1'
|
438
|
+
# Host name or IP address of this watchdog
|
439
|
+
wd_port = 9000
|
440
|
+
# port number for watchdog service
|
441
|
+
wd_interval = 10
|
442
|
+
# lifecheck interval (sec) > 0
|
443
|
+
ping_path = '/bin'
|
444
|
+
# ping command path
|
445
|
+
ifconfig_path = '/sbin'
|
446
|
+
# ifconfig command path
|
447
|
+
if_up_cmd = 'ifconfig eth0:0 inet $_IP_$ netmask 255.255.255.0'
|
448
|
+
# startup delegate IP command
|
449
|
+
if_down_cmd = 'ifconfig eth0:0 down'
|
450
|
+
# shutdown delegate IP command
|
451
|
+
wd_life_point = 3
|
452
|
+
# lifecheck retry times
|
453
|
+
wd_lifecheck_query = 'SELECT 1'
|
454
|
+
# lifecheck query to pgpool from watchdog
|
455
|
+
# Other pgpool Connection Settings
|
456
|
+
|
457
|
+
other_pgpool_hostname0 = 'vm2'
|
458
|
+
# Host name or IP address to connect to for other pgpool 0
|
459
|
+
other_pgpool_port0 = 9999
|
460
|
+
# Port number for othet pgpool 0
|
461
|
+
other_wd_port0 = 9000
|
462
|
+
# Port number for othet watchdog 0
|
463
|
+
#other_pgpool_hostname1 = 'vm1'
|
464
|
+
#other_pgpool_port1 = 9999
|
465
|
+
#other_wd_port1 = 9000
|
466
|
+
|
467
|
+
#------------------------------------------------------------------------------
|
468
|
+
# OTHERS
|
469
|
+
#------------------------------------------------------------------------------
|
470
|
+
relcache_expire = 0
|
471
|
+
# Life time of relation cache in seconds.
|
472
|
+
# 0 means no cache expiration(the default).
|
473
|
+
# The relation cache is used for cache the
|
474
|
+
# query result against PostgreSQL system
|
475
|
+
# catalog to obtain various information
|
476
|
+
# including table structures or if it's a
|
477
|
+
# temporary table or not. The cache is
|
478
|
+
# maintained in a pgpool child local memory
|
479
|
+
# and being kept as long as it survives.
|
480
|
+
# If someone modify the table by using
|
481
|
+
# ALTER TABLE or some such, the relcache is
|
482
|
+
# not consistent anymore.
|
483
|
+
# For this purpose, cache_expiration
|
484
|
+
# controls the life time of the cache.
|
485
|
+
|
486
|
+
relcache_size = 256
|
487
|
+
# Number of relation cache
|
488
|
+
# entry. If you see frequently:
|
489
|
+
# "pool_search_relcache: cache replacement happend"
|
490
|
+
# in the pgpool log, you might want to increate this number.
|
491
|
+
|
492
|
+
check_temp_table = on
|
493
|
+
# If on, enable temporary table check in SELECT statements.
|
494
|
+
# This initiates queries against system catalog of primary/master
|
495
|
+
# thus increases load of master.
|
496
|
+
# If you are absolutely sure that your system never uses temporary tables
|
497
|
+
# and you want to save access to primary/master, you could turn this off.
|
498
|
+
# Default is on.
|
499
|
+
|
500
|
+
|
501
|
+
#------------------------------------------------------------------------------
|
502
|
+
# ON MEMORY QUERY MEMORY CACHE
|
503
|
+
#------------------------------------------------------------------------------
|
504
|
+
# If on, use the memory cache functionality, off by default
|
505
|
+
memory_cache_enabled = off
|
506
|
+
|
507
|
+
# Cache storage method. either 'shmem'(shared memory) or 'memcached'. 'shmem' by default
|
508
|
+
memqcache_method = 'shmem'
|
509
|
+
|
510
|
+
# Memcached host name or IP address. Mandatory if memqcache_method = 'memcached'.
|
511
|
+
# Defaults to localhost
|
512
|
+
memqcache_memcached_host = 'localhost'
|
513
|
+
|
514
|
+
# Memcached port number. Mondatory if memqcache_method = 'memcached'.
|
515
|
+
# Defaults to 11211
|
516
|
+
memqcache_memcached_port = 11211
|
517
|
+
|
518
|
+
# Total memory size in bytes for storing memory cache. Mandatory if memqcache_method = 'shmem'.
|
519
|
+
# Defaults to 64MB.
|
520
|
+
memqcache_total_size = 67108864
|
521
|
+
|
522
|
+
# Total number of cache entries. Mandatory if memqcache_method = 'shmem'.
|
523
|
+
# Each cache entry consumes 48 bytes on shared memory. Defaults to 1,000,000(45.8MB).
|
524
|
+
memqcache_max_num_cache = 1000000
|
525
|
+
|
526
|
+
# Memory cache entry life time specified in seconds.
|
527
|
+
# 0 means infinite life time. 0 by default.
|
528
|
+
memqcache_expire = 0
|
529
|
+
|
530
|
+
# If on, invalidation of query cache is triggered by corresponding
|
531
|
+
# DDL/DML/DCL(and memqcache_expire). If off, it is only triggered
|
532
|
+
# by memqcache_expire. on by default.
|
533
|
+
memqcache_auto_cache_invalidation = on
|
534
|
+
|
535
|
+
# Maximum SELECT result size in bytes.
|
536
|
+
# Must be smaller than memqcache_cache_block_size. Defaults to 400KB.
|
537
|
+
memqcache_maxcache = 409600
|
538
|
+
|
539
|
+
# Cache block size in bytes. Mandatory if memqcache_method = 'shmem'.
|
540
|
+
# Defaults to 1MB.
|
541
|
+
memqcache_cache_block_size = 1048576
|
542
|
+
|
543
|
+
# Temporary work directory to record table oids
|
544
|
+
memqcache_oiddir = '/var/log/pgpool/oiddir'
|
545
|
+
|
546
|
+
white_memqcache_table_list = ''
|
547
|
+
# Comma separated list of table names to memcache
|
548
|
+
# that don't write to database
|
549
|
+
# Regexp are accepted
|
550
|
+
black_memqcache_table_list = ''
|
551
|
+
# Comma separated list of table names not to memcache
|
552
|
+
# that don't write to database
|
553
|
+
# Regexp are accepted
|