prestogres 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (393) hide show
  1. data/.gitignore +4 -0
  2. data/Gemfile +2 -0
  3. data/Gemfile.lock +20 -0
  4. data/LICENSE +202 -0
  5. data/NOTICE +22 -0
  6. data/README.md +217 -0
  7. data/Rakefile +13 -0
  8. data/VERSION +1 -0
  9. data/bin/prestogres +254 -0
  10. data/config/pcp.conf.sample +28 -0
  11. data/config/pgpool.conf +678 -0
  12. data/config/pool_hba.conf +84 -0
  13. data/config/pool_passwd +0 -0
  14. data/config/postgresql.conf +2 -0
  15. data/ext/.gitignore +6 -0
  16. data/ext/depend +26 -0
  17. data/ext/extconf.rb +4 -0
  18. data/ext/prestogres_config.c +12 -0
  19. data/pgpool2/.gitignore +36 -0
  20. data/pgpool2/AUTHORS +4 -0
  21. data/pgpool2/COPYING +12 -0
  22. data/pgpool2/ChangeLog +1 -0
  23. data/pgpool2/INSTALL +1 -0
  24. data/pgpool2/Makefile.am +159 -0
  25. data/pgpool2/Makefile.in +1187 -0
  26. data/pgpool2/NEWS +4960 -0
  27. data/pgpool2/README +1 -0
  28. data/pgpool2/README.euc_jp +1 -0
  29. data/pgpool2/README.online-recovery +62 -0
  30. data/pgpool2/TODO +103 -0
  31. data/pgpool2/ac_func_accept_argtypes.m4 +85 -0
  32. data/pgpool2/aclocal.m4 +1088 -0
  33. data/pgpool2/c-compiler.m4 +134 -0
  34. data/pgpool2/c-library.m4 +325 -0
  35. data/pgpool2/child.c +2097 -0
  36. data/pgpool2/config.guess +1532 -0
  37. data/pgpool2/config.h.in +332 -0
  38. data/pgpool2/config.sub +1640 -0
  39. data/pgpool2/configure +15752 -0
  40. data/pgpool2/configure.in +392 -0
  41. data/pgpool2/depcomp +522 -0
  42. data/pgpool2/doc/basebackup.sh +17 -0
  43. data/pgpool2/doc/pgpool-de.html +4220 -0
  44. data/pgpool2/doc/pgpool-en.html +5738 -0
  45. data/pgpool2/doc/pgpool-fr.html +4118 -0
  46. data/pgpool2/doc/pgpool-ja.css +198 -0
  47. data/pgpool2/doc/pgpool-ja.html +11279 -0
  48. data/pgpool2/doc/pgpool-zh_cn.html +4445 -0
  49. data/pgpool2/doc/pgpool.css +280 -0
  50. data/pgpool2/doc/pgpool_remote_start +13 -0
  51. data/pgpool2/doc/recovery.conf.sample +117 -0
  52. data/pgpool2/doc/tutorial-en.html +707 -0
  53. data/pgpool2/doc/tutorial-ja.html +422 -0
  54. data/pgpool2/doc/tutorial-memqcache-en.html +325 -0
  55. data/pgpool2/doc/tutorial-memqcache-ja.html +370 -0
  56. data/pgpool2/doc/tutorial-memqcache-zh_cn.html +322 -0
  57. data/pgpool2/doc/tutorial-watchdog-en.html +306 -0
  58. data/pgpool2/doc/tutorial-watchdog-ja.html +343 -0
  59. data/pgpool2/doc/tutorial-watchdog-zh_cn.html +301 -0
  60. data/pgpool2/doc/tutorial-zh_cn.html +537 -0
  61. data/pgpool2/doc/watchdog.png +0 -0
  62. data/pgpool2/doc/wd-en.html +236 -0
  63. data/pgpool2/doc/wd-en.jpg +0 -0
  64. data/pgpool2/doc/wd-ja.html +219 -0
  65. data/pgpool2/doc/wd-ja.jpg +0 -0
  66. data/pgpool2/doc/wd-zh_cn.html +201 -0
  67. data/pgpool2/doc/where_to_send_queries.odg +0 -0
  68. data/pgpool2/doc/where_to_send_queries.pdf +0 -0
  69. data/pgpool2/general.m4 +166 -0
  70. data/pgpool2/getopt_long.c +200 -0
  71. data/pgpool2/getopt_long.h +44 -0
  72. data/pgpool2/install-sh +251 -0
  73. data/pgpool2/ltmain.sh +8406 -0
  74. data/pgpool2/m4/libtool.m4 +7360 -0
  75. data/pgpool2/m4/ltoptions.m4 +368 -0
  76. data/pgpool2/m4/ltsugar.m4 +123 -0
  77. data/pgpool2/m4/ltversion.m4 +23 -0
  78. data/pgpool2/m4/lt~obsolete.m4 +92 -0
  79. data/pgpool2/main.c +2971 -0
  80. data/pgpool2/md5.c +444 -0
  81. data/pgpool2/md5.h +28 -0
  82. data/pgpool2/missing +360 -0
  83. data/pgpool2/mkinstalldirs +40 -0
  84. data/pgpool2/parser/Makefile.am +50 -0
  85. data/pgpool2/parser/Makefile.in +559 -0
  86. data/pgpool2/parser/copyfuncs.c +3310 -0
  87. data/pgpool2/parser/gram.c +39100 -0
  88. data/pgpool2/parser/gram.h +940 -0
  89. data/pgpool2/parser/gram.y +13408 -0
  90. data/pgpool2/parser/gramparse.h +74 -0
  91. data/pgpool2/parser/keywords.c +32 -0
  92. data/pgpool2/parser/keywords.h +39 -0
  93. data/pgpool2/parser/kwlist.h +425 -0
  94. data/pgpool2/parser/kwlookup.c +88 -0
  95. data/pgpool2/parser/list.c +1156 -0
  96. data/pgpool2/parser/makefuncs.c +518 -0
  97. data/pgpool2/parser/makefuncs.h +83 -0
  98. data/pgpool2/parser/memnodes.h +79 -0
  99. data/pgpool2/parser/nodes.c +29 -0
  100. data/pgpool2/parser/nodes.h +609 -0
  101. data/pgpool2/parser/outfuncs.c +5790 -0
  102. data/pgpool2/parser/parsenodes.h +2615 -0
  103. data/pgpool2/parser/parser.c +262 -0
  104. data/pgpool2/parser/parser.h +46 -0
  105. data/pgpool2/parser/pg_class.h +158 -0
  106. data/pgpool2/parser/pg_config_manual.h +273 -0
  107. data/pgpool2/parser/pg_list.h +352 -0
  108. data/pgpool2/parser/pg_trigger.h +147 -0
  109. data/pgpool2/parser/pg_wchar.h +492 -0
  110. data/pgpool2/parser/pool_memory.c +342 -0
  111. data/pgpool2/parser/pool_memory.h +77 -0
  112. data/pgpool2/parser/pool_parser.h +222 -0
  113. data/pgpool2/parser/pool_string.c +121 -0
  114. data/pgpool2/parser/pool_string.h +37 -0
  115. data/pgpool2/parser/primnodes.h +1280 -0
  116. data/pgpool2/parser/scan.c +4094 -0
  117. data/pgpool2/parser/scan.l +1451 -0
  118. data/pgpool2/parser/scanner.h +120 -0
  119. data/pgpool2/parser/scansup.c +221 -0
  120. data/pgpool2/parser/scansup.h +28 -0
  121. data/pgpool2/parser/snprintf.c +1102 -0
  122. data/pgpool2/parser/stringinfo.c +294 -0
  123. data/pgpool2/parser/stringinfo.h +178 -0
  124. data/pgpool2/parser/value.c +78 -0
  125. data/pgpool2/parser/value.h +62 -0
  126. data/pgpool2/parser/wchar.c +2048 -0
  127. data/pgpool2/pcp.conf.sample +28 -0
  128. data/pgpool2/pcp/Makefile.am +40 -0
  129. data/pgpool2/pcp/Makefile.in +771 -0
  130. data/pgpool2/pcp/libpcp_ext.h +250 -0
  131. data/pgpool2/pcp/md5.c +444 -0
  132. data/pgpool2/pcp/md5.h +28 -0
  133. data/pgpool2/pcp/pcp.c +1652 -0
  134. data/pgpool2/pcp/pcp.h +61 -0
  135. data/pgpool2/pcp/pcp_attach_node.c +172 -0
  136. data/pgpool2/pcp/pcp_detach_node.c +185 -0
  137. data/pgpool2/pcp/pcp_error.c +87 -0
  138. data/pgpool2/pcp/pcp_node_count.c +160 -0
  139. data/pgpool2/pcp/pcp_node_info.c +198 -0
  140. data/pgpool2/pcp/pcp_pool_status.c +166 -0
  141. data/pgpool2/pcp/pcp_proc_count.c +166 -0
  142. data/pgpool2/pcp/pcp_proc_info.c +261 -0
  143. data/pgpool2/pcp/pcp_promote_node.c +185 -0
  144. data/pgpool2/pcp/pcp_recovery_node.c +172 -0
  145. data/pgpool2/pcp/pcp_stop_pgpool.c +179 -0
  146. data/pgpool2/pcp/pcp_stream.c +385 -0
  147. data/pgpool2/pcp/pcp_stream.h +52 -0
  148. data/pgpool2/pcp/pcp_systemdb_info.c +194 -0
  149. data/pgpool2/pcp/pcp_watchdog_info.c +211 -0
  150. data/pgpool2/pcp_child.c +1493 -0
  151. data/pgpool2/pg_md5.c +305 -0
  152. data/pgpool2/pgpool.8.in +121 -0
  153. data/pgpool2/pgpool.conf +553 -0
  154. data/pgpool2/pgpool.conf.sample +666 -0
  155. data/pgpool2/pgpool.conf.sample-master-slave +665 -0
  156. data/pgpool2/pgpool.conf.sample-replication +664 -0
  157. data/pgpool2/pgpool.conf.sample-stream +664 -0
  158. data/pgpool2/pgpool.spec +264 -0
  159. data/pgpool2/pgpool_adm/TODO +7 -0
  160. data/pgpool2/pgpool_adm/pgpool_adm--1.0.sql +85 -0
  161. data/pgpool2/pgpool_adm/pgpool_adm.c +558 -0
  162. data/pgpool2/pgpool_adm/pgpool_adm.control +5 -0
  163. data/pgpool2/pgpool_adm/pgpool_adm.h +46 -0
  164. data/pgpool2/pgpool_adm/pgpool_adm.sql.in +85 -0
  165. data/pgpool2/pool.h +655 -0
  166. data/pgpool2/pool_auth.c +1390 -0
  167. data/pgpool2/pool_config.c +5007 -0
  168. data/pgpool2/pool_config.h +284 -0
  169. data/pgpool2/pool_config.l +3281 -0
  170. data/pgpool2/pool_config_md5.c +29 -0
  171. data/pgpool2/pool_connection_pool.c +812 -0
  172. data/pgpool2/pool_error.c +242 -0
  173. data/pgpool2/pool_globals.c +27 -0
  174. data/pgpool2/pool_hba.c +1723 -0
  175. data/pgpool2/pool_hba.conf.sample +67 -0
  176. data/pgpool2/pool_ip.c +567 -0
  177. data/pgpool2/pool_ip.h +65 -0
  178. data/pgpool2/pool_ipc.h +38 -0
  179. data/pgpool2/pool_lobj.c +242 -0
  180. data/pgpool2/pool_lobj.h +32 -0
  181. data/pgpool2/pool_memqcache.c +3818 -0
  182. data/pgpool2/pool_memqcache.h +268 -0
  183. data/pgpool2/pool_params.c +163 -0
  184. data/pgpool2/pool_passwd.c +249 -0
  185. data/pgpool2/pool_passwd.h +41 -0
  186. data/pgpool2/pool_path.c +193 -0
  187. data/pgpool2/pool_path.h +81 -0
  188. data/pgpool2/pool_process_context.c +247 -0
  189. data/pgpool2/pool_process_context.h +62 -0
  190. data/pgpool2/pool_process_query.c +5001 -0
  191. data/pgpool2/pool_process_reporting.c +1671 -0
  192. data/pgpool2/pool_process_reporting.h +44 -0
  193. data/pgpool2/pool_proto2.c +671 -0
  194. data/pgpool2/pool_proto_modules.c +3524 -0
  195. data/pgpool2/pool_proto_modules.h +185 -0
  196. data/pgpool2/pool_query_cache.c +1020 -0
  197. data/pgpool2/pool_query_context.c +1871 -0
  198. data/pgpool2/pool_query_context.h +105 -0
  199. data/pgpool2/pool_relcache.c +284 -0
  200. data/pgpool2/pool_relcache.h +78 -0
  201. data/pgpool2/pool_rewrite_outfuncs.c +9060 -0
  202. data/pgpool2/pool_rewrite_query.c +715 -0
  203. data/pgpool2/pool_rewrite_query.h +192 -0
  204. data/pgpool2/pool_select_walker.c +1150 -0
  205. data/pgpool2/pool_select_walker.h +68 -0
  206. data/pgpool2/pool_sema.c +161 -0
  207. data/pgpool2/pool_session_context.c +952 -0
  208. data/pgpool2/pool_session_context.h +203 -0
  209. data/pgpool2/pool_shmem.c +185 -0
  210. data/pgpool2/pool_signal.c +158 -0
  211. data/pgpool2/pool_signal.h +61 -0
  212. data/pgpool2/pool_ssl.c +339 -0
  213. data/pgpool2/pool_stream.c +962 -0
  214. data/pgpool2/pool_stream.h +61 -0
  215. data/pgpool2/pool_system.c +659 -0
  216. data/pgpool2/pool_timestamp.c +1215 -0
  217. data/pgpool2/pool_timestamp.h +38 -0
  218. data/pgpool2/pool_type.h +171 -0
  219. data/pgpool2/pool_worker_child.c +384 -0
  220. data/pgpool2/ps_status.c +404 -0
  221. data/pgpool2/recovery.c +435 -0
  222. data/pgpool2/redhat/pgpool.conf.sample.patch +52 -0
  223. data/pgpool2/redhat/pgpool.init +201 -0
  224. data/pgpool2/redhat/pgpool.sysconfig +7 -0
  225. data/pgpool2/redhat/rpm_installer/basebackup-replication.sh +53 -0
  226. data/pgpool2/redhat/rpm_installer/basebackup-stream.sh +55 -0
  227. data/pgpool2/redhat/rpm_installer/config_for_script +17 -0
  228. data/pgpool2/redhat/rpm_installer/failover.sh +64 -0
  229. data/pgpool2/redhat/rpm_installer/getsources.sh +141 -0
  230. data/pgpool2/redhat/rpm_installer/install.sh +1363 -0
  231. data/pgpool2/redhat/rpm_installer/pgpool_recovery_pitr +47 -0
  232. data/pgpool2/redhat/rpm_installer/pgpool_remote_start +15 -0
  233. data/pgpool2/redhat/rpm_installer/recovery.conf +4 -0
  234. data/pgpool2/redhat/rpm_installer/uninstall.sh +57 -0
  235. data/pgpool2/sample/dist_def_pgbench.sql +73 -0
  236. data/pgpool2/sample/pgpool.pam +3 -0
  237. data/pgpool2/sample/pgpool_recovery +20 -0
  238. data/pgpool2/sample/pgpool_recovery_pitr +19 -0
  239. data/pgpool2/sample/pgpool_remote_start +13 -0
  240. data/pgpool2/sample/replicate_def_pgbench.sql +18 -0
  241. data/pgpool2/sql/insert_lock.sql +15 -0
  242. data/pgpool2/sql/pgpool-recovery/pgpool-recovery.c +280 -0
  243. data/pgpool2/sql/pgpool-recovery/pgpool-recovery.sql.in +19 -0
  244. data/pgpool2/sql/pgpool-recovery/pgpool_recovery--1.0.sql +24 -0
  245. data/pgpool2/sql/pgpool-recovery/pgpool_recovery.control +5 -0
  246. data/pgpool2/sql/pgpool-recovery/uninstall_pgpool-recovery.sql +3 -0
  247. data/pgpool2/sql/pgpool-regclass/pgpool-regclass.c +206 -0
  248. data/pgpool2/sql/pgpool-regclass/pgpool-regclass.sql.in +4 -0
  249. data/pgpool2/sql/pgpool-regclass/pgpool_regclass--1.0.sql +7 -0
  250. data/pgpool2/sql/pgpool-regclass/pgpool_regclass.control +5 -0
  251. data/pgpool2/sql/pgpool-regclass/uninstall_pgpool-regclass.sql +1 -0
  252. data/pgpool2/sql/system_db.sql +38 -0
  253. data/pgpool2/strlcpy.c +85 -0
  254. data/pgpool2/test/C/test_extended.c +98 -0
  255. data/pgpool2/test/jdbc/.cvsignore +2 -0
  256. data/pgpool2/test/jdbc/AutoCommitTest.java +45 -0
  257. data/pgpool2/test/jdbc/BatchTest.java +55 -0
  258. data/pgpool2/test/jdbc/ColumnTest.java +60 -0
  259. data/pgpool2/test/jdbc/CreateTempTableTest.java +48 -0
  260. data/pgpool2/test/jdbc/InsertTest.java +34 -0
  261. data/pgpool2/test/jdbc/LockTest.java +36 -0
  262. data/pgpool2/test/jdbc/PgpoolTest.java +75 -0
  263. data/pgpool2/test/jdbc/README.euc_jp +73 -0
  264. data/pgpool2/test/jdbc/RunTest.java +83 -0
  265. data/pgpool2/test/jdbc/SelectTest.java +37 -0
  266. data/pgpool2/test/jdbc/UpdateTest.java +32 -0
  267. data/pgpool2/test/jdbc/expected/CreateTempTable +1 -0
  268. data/pgpool2/test/jdbc/expected/autocommit +10 -0
  269. data/pgpool2/test/jdbc/expected/batch +1 -0
  270. data/pgpool2/test/jdbc/expected/column +100 -0
  271. data/pgpool2/test/jdbc/expected/insert +1 -0
  272. data/pgpool2/test/jdbc/expected/lock +100 -0
  273. data/pgpool2/test/jdbc/expected/select +2 -0
  274. data/pgpool2/test/jdbc/expected/update +1 -0
  275. data/pgpool2/test/jdbc/pgpool.properties +7 -0
  276. data/pgpool2/test/jdbc/prepare.sql +54 -0
  277. data/pgpool2/test/jdbc/run.sh +6 -0
  278. data/pgpool2/test/parser/.cvsignore +6 -0
  279. data/pgpool2/test/parser/README +32 -0
  280. data/pgpool2/test/parser/expected/copy.out +17 -0
  281. data/pgpool2/test/parser/expected/create.out +64 -0
  282. data/pgpool2/test/parser/expected/cursor.out +37 -0
  283. data/pgpool2/test/parser/expected/delete.out +10 -0
  284. data/pgpool2/test/parser/expected/drop.out +12 -0
  285. data/pgpool2/test/parser/expected/insert.out +13 -0
  286. data/pgpool2/test/parser/expected/misc.out +28 -0
  287. data/pgpool2/test/parser/expected/prepare.out +4 -0
  288. data/pgpool2/test/parser/expected/privileges.out +31 -0
  289. data/pgpool2/test/parser/expected/scanner.out +30 -0
  290. data/pgpool2/test/parser/expected/select.out +89 -0
  291. data/pgpool2/test/parser/expected/transaction.out +38 -0
  292. data/pgpool2/test/parser/expected/update.out +11 -0
  293. data/pgpool2/test/parser/expected/v84.out +37 -0
  294. data/pgpool2/test/parser/expected/v90.out +25 -0
  295. data/pgpool2/test/parser/expected/var.out +22 -0
  296. data/pgpool2/test/parser/input/alter.sql +2 -0
  297. data/pgpool2/test/parser/input/copy.sql +17 -0
  298. data/pgpool2/test/parser/input/create.sql +64 -0
  299. data/pgpool2/test/parser/input/cursor.sql +37 -0
  300. data/pgpool2/test/parser/input/delete.sql +10 -0
  301. data/pgpool2/test/parser/input/drop.sql +12 -0
  302. data/pgpool2/test/parser/input/insert.sql +13 -0
  303. data/pgpool2/test/parser/input/misc.sql +28 -0
  304. data/pgpool2/test/parser/input/prepare.sql +4 -0
  305. data/pgpool2/test/parser/input/privileges.sql +31 -0
  306. data/pgpool2/test/parser/input/scanner.sql +34 -0
  307. data/pgpool2/test/parser/input/select.sql +89 -0
  308. data/pgpool2/test/parser/input/transaction.sql +38 -0
  309. data/pgpool2/test/parser/input/update.sql +11 -0
  310. data/pgpool2/test/parser/input/v84.sql +37 -0
  311. data/pgpool2/test/parser/input/v90.sql +38 -0
  312. data/pgpool2/test/parser/input/var.sql +22 -0
  313. data/pgpool2/test/parser/main.c +96 -0
  314. data/pgpool2/test/parser/parse_schedule +16 -0
  315. data/pgpool2/test/parser/pool.h +13 -0
  316. data/pgpool2/test/parser/run-test +62 -0
  317. data/pgpool2/test/pdo-test/README.euc_jp +58 -0
  318. data/pgpool2/test/pdo-test/SQLlist/test1.sql +3 -0
  319. data/pgpool2/test/pdo-test/SQLlist/test2.sql +3 -0
  320. data/pgpool2/test/pdo-test/collections.inc +11 -0
  321. data/pgpool2/test/pdo-test/def.inc +7 -0
  322. data/pgpool2/test/pdo-test/log.txt +0 -0
  323. data/pgpool2/test/pdo-test/mod/database.inc +36 -0
  324. data/pgpool2/test/pdo-test/mod/def.inc +0 -0
  325. data/pgpool2/test/pdo-test/mod/errorhandler.inc +27 -0
  326. data/pgpool2/test/pdo-test/pdotest.php +11 -0
  327. data/pgpool2/test/pdo-test/regsql.inc +56 -0
  328. data/pgpool2/test/pgpool_setup +898 -0
  329. data/pgpool2/test/regression/README +39 -0
  330. data/pgpool2/test/regression/clean.sh +21 -0
  331. data/pgpool2/test/regression/libs.sh +16 -0
  332. data/pgpool2/test/regression/regress.sh +166 -0
  333. data/pgpool2/test/regression/tests/001.load_balance/test.sh +128 -0
  334. data/pgpool2/test/regression/tests/002.native_replication/PgTester.java +47 -0
  335. data/pgpool2/test/regression/tests/002.native_replication/create.sql +6 -0
  336. data/pgpool2/test/regression/tests/002.native_replication/test.sh +71 -0
  337. data/pgpool2/test/regression/tests/003.failover/expected.r +6 -0
  338. data/pgpool2/test/regression/tests/003.failover/expected.s +6 -0
  339. data/pgpool2/test/regression/tests/003.failover/test.sh +45 -0
  340. data/pgpool2/test/regression/tests/004.watchdog/master.conf +12 -0
  341. data/pgpool2/test/regression/tests/004.watchdog/standby.conf +19 -0
  342. data/pgpool2/test/regression/tests/004.watchdog/test.sh +52 -0
  343. data/pgpool2/test/regression/tests/050.bug58/test.sh +50 -0
  344. data/pgpool2/test/regression/tests/051.bug60/bug.sql +12 -0
  345. data/pgpool2/test/regression/tests/051.bug60/database-clean.sql +6 -0
  346. data/pgpool2/test/regression/tests/051.bug60/database-setup.sql +28 -0
  347. data/pgpool2/test/regression/tests/051.bug60/test.sh +79 -0
  348. data/pgpool2/test/regression/tests/052.do_query/test.sh +44 -0
  349. data/pgpool2/test/regression/tests/053.insert_lock_hangs/test.sh +81 -0
  350. data/pgpool2/test/regression/tests/054.postgres_fdw/test.sh +67 -0
  351. data/pgpool2/test/regression/tests/055.backend_all_down/test.sh +52 -0
  352. data/pgpool2/test/regression/tests/056.bug63/jdbctest2.java +66 -0
  353. data/pgpool2/test/regression/tests/056.bug63/test.sh +47 -0
  354. data/pgpool2/test/regression/tests/057.bug61/test.sh +40 -0
  355. data/pgpool2/test/regression/tests/058.bug68/jdbctest3.java +45 -0
  356. data/pgpool2/test/regression/tests/058.bug68/test.sh +47 -0
  357. data/pgpool2/test/timestamp/expected/insert.out +16 -0
  358. data/pgpool2/test/timestamp/expected/misc.out +3 -0
  359. data/pgpool2/test/timestamp/expected/update.out +6 -0
  360. data/pgpool2/test/timestamp/input/insert.sql +16 -0
  361. data/pgpool2/test/timestamp/input/misc.sql +3 -0
  362. data/pgpool2/test/timestamp/input/update.sql +6 -0
  363. data/pgpool2/test/timestamp/main.c +129 -0
  364. data/pgpool2/test/timestamp/parse_schedule +3 -0
  365. data/pgpool2/test/timestamp/run-test +69 -0
  366. data/pgpool2/version.h +1 -0
  367. data/pgpool2/watchdog/Makefile.am +17 -0
  368. data/pgpool2/watchdog/Makefile.in +505 -0
  369. data/pgpool2/watchdog/test/stab.c +266 -0
  370. data/pgpool2/watchdog/test/test.c +85 -0
  371. data/pgpool2/watchdog/test/wd_child_t.c +87 -0
  372. data/pgpool2/watchdog/test/wd_lifecheck_t.c +87 -0
  373. data/pgpool2/watchdog/test/wd_packet_t.c +87 -0
  374. data/pgpool2/watchdog/test/wd_ping_t.c +20 -0
  375. data/pgpool2/watchdog/watchdog.c +408 -0
  376. data/pgpool2/watchdog/watchdog.h +209 -0
  377. data/pgpool2/watchdog/wd_child.c +444 -0
  378. data/pgpool2/watchdog/wd_ext.h +123 -0
  379. data/pgpool2/watchdog/wd_heartbeat.c +577 -0
  380. data/pgpool2/watchdog/wd_if.c +216 -0
  381. data/pgpool2/watchdog/wd_init.c +126 -0
  382. data/pgpool2/watchdog/wd_interlock.c +347 -0
  383. data/pgpool2/watchdog/wd_lifecheck.c +512 -0
  384. data/pgpool2/watchdog/wd_list.c +429 -0
  385. data/pgpool2/watchdog/wd_packet.c +1159 -0
  386. data/pgpool2/watchdog/wd_ping.c +330 -0
  387. data/pgpool2/ylwrap +223 -0
  388. data/pgsql/presto_client.py +346 -0
  389. data/pgsql/prestogres.py +156 -0
  390. data/pgsql/setup_functions.sql +21 -0
  391. data/pgsql/setup_language.sql +3 -0
  392. data/prestogres.gemspec +23 -0
  393. metadata +496 -0
data/Rakefile ADDED
@@ -0,0 +1,13 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ require 'rake/extensiontask'
5
+
6
+ spec = eval File.read("prestogres.gemspec")
7
+ Rake::ExtensionTask.new('prestogres', spec) do |ext|
8
+ ext.cross_compile = true
9
+ ext.lib_dir = File.join(*['lib', 'prestogres', ENV['FAT_DIR']].compact)
10
+ #ext.cross_platform = 'i386-mswin32'
11
+ end
12
+
13
+ task :default => [:build]
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
data/bin/prestogres ADDED
@@ -0,0 +1,254 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ config = {
4
+ data_dir: nil,
5
+ command: nil,
6
+ binary: nil,
7
+ }
8
+
9
+ def usage(error=nil)
10
+ puts "usage: #{File.basename($0)} -D <data dir> <command>"
11
+ puts "commands:"
12
+ puts " setup setup <data dir>"
13
+ puts " pgpool start pgpool as a daemon process"
14
+ puts " pgpool stop stop pgpool daemon process"
15
+ puts " pgpool -n start pgpool as a foreground process"
16
+ puts " pg_ctl start start postgres server as a daemon process"
17
+ puts " pg_ctl stop stop postgres server daemon process"
18
+ puts " postgres start postgres server as a foreground process"
19
+ puts " passwd <USER NAME> add new md5 password entry for an user"
20
+ puts ""
21
+ puts "error: #{error}" if error
22
+ exit 0
23
+ end
24
+
25
+ config_key = false
26
+
27
+ arg_offset = 0
28
+ ARGV.each_with_index do |a,i|
29
+ arg_offset = i + 1
30
+
31
+ if config_key
32
+ config[config_key] = a
33
+ config_key = nil
34
+ next
35
+ end
36
+
37
+ case a
38
+ when "-D"
39
+ config_key = :data_dir
40
+ when "-h", "-?", "--help"
41
+ config[:command] = :help
42
+ when "setup"
43
+ config[:command] = :setup
44
+ when "pgpool"
45
+ config[:command] = :pgpool
46
+ break
47
+ when "pg_ctl"
48
+ config[:command] = :pg_ctl
49
+ break
50
+ when "postgres"
51
+ config[:command] = :postgres
52
+ break
53
+ when "passwd"
54
+ config[:command] = :passwd
55
+ break
56
+ end
57
+ end
58
+
59
+ usage nil if config_key
60
+ usage nil unless config[:command]
61
+
62
+ args = ARGV[arg_offset..-1]
63
+
64
+ setup_params = {
65
+ port: 9900,
66
+ backend_port: 6432,
67
+ pgpool_pid_file: nil,
68
+ pgpool_status_dir: nil,
69
+ unix_socket_directory: nil,
70
+ }
71
+
72
+ case config[:command]
73
+ when :help
74
+ usage nil
75
+
76
+ when :setup
77
+ unless config[:data_dir]
78
+ usage "-D option is required"
79
+ end
80
+ unless args.empty?
81
+ usage nil
82
+ end
83
+
84
+ require "erb"
85
+ require "fileutils"
86
+
87
+ def run_setup_command(cmdline)
88
+ if cmdline.is_a?(Array)
89
+ puts "setup> #{cmdline.join(' ')}"
90
+ system *cmdline
91
+ else
92
+ puts "setup> #{cmdline}"
93
+ system cmdline
94
+ end
95
+ unless $?.success?
96
+ puts "******************"
97
+ puts "** setup failed **"
98
+ puts "******************"
99
+ puts ""
100
+ puts "-D directory is inconsistent."
101
+ puts "If you're running command on Mac OS X, you might need to run following commands:"
102
+ puts ""
103
+ puts " $ sudo sysctl -w kern.sysv.shmmax=1073741824"
104
+ puts " $ sudo sysctl -w kern.sysv.shmall=1073741824"
105
+ puts ""
106
+ puts "Please delete the directory (rm -rf) first before retrying."
107
+ puts ""
108
+ exit 1
109
+ end
110
+ end
111
+
112
+ config_src_dir = File.join(File.dirname(__FILE__), "..", "config")
113
+ pgsql_dir = File.join(File.dirname(__FILE__), "..", "pgsql")
114
+
115
+ puts "Setting up '#{config[:data_dir]}'..."
116
+ data_dir = File.expand_path(config[:data_dir])
117
+
118
+ @config = setup_params # used by erb files
119
+ @config[:pgpool_pid_file] = File.join(data_dir, "run", "pgpool.pid")
120
+ @config[:pgpool_status_dir] = File.join(data_dir, "run")
121
+ @config[:unix_socket_directory] = File.join(data_dir, "run")
122
+
123
+ # log & socket dirs
124
+ FileUtils.mkdir_p File.join(data_dir, "log")
125
+ FileUtils.mkdir_p File.join(data_dir, "run")
126
+
127
+ # pgpool
128
+ FileUtils.mkdir_p File.join(data_dir, "pgpool")
129
+ %w[pcp.conf.sample pgpool.conf pool_hba.conf pool_passwd].each do |fname|
130
+ File.open(File.join(data_dir, "pgpool", fname), "w") {|f|
131
+ f.write ERB.new(File.read(File.join(config_src_dir, fname))).result
132
+ }
133
+ end
134
+
135
+ # postgresql
136
+ run_setup_command %w[initdb -U pg --no-locale -E UNICODE] + [File.join(data_dir, "postgres")]
137
+ File.open(File.join(data_dir, "postgres", "postgresql.conf"), "a") {|f|
138
+ f.write ERB.new(File.read(File.join(config_src_dir, "postgresql.conf"))).result
139
+ }
140
+
141
+ # setup functions
142
+ run_setup_command %w[pg_ctl -D] + [File.join(data_dir, 'postgres')] + %w[start]
143
+ begin
144
+ sleep 1
145
+
146
+ run_setup_command "psql -h 127.0.0.1 -p #{setup_params[:backend_port]} -U pg postgres < #{File.join(pgsql_dir, "setup_language.sql")}"
147
+ run_setup_command "psql -h 127.0.0.1 -p #{setup_params[:backend_port]} -U pg postgres < #{File.join(pgsql_dir, "setup_functions.sql")}"
148
+ ensure
149
+ run_setup_command %w[pg_ctl -D] + [File.join(data_dir, 'postgres')] + %w[stop]
150
+ end
151
+
152
+ puts <<EOF
153
+
154
+ ************************************************************
155
+ ** PostgreSQL protocol gateway for Presto **
156
+ ************************************************************
157
+
158
+ +------------+ +------------+ +--------+
159
+ client ---> pgpool-II ----> PostgreSQL ----> Presto |
160
+ +------------+ +------------+ +--------+
161
+ rewrite query proxy run query
162
+
163
+ You can run queries on Presto as following:
164
+
165
+ * Set presto_server and presto_catalog to pgpool.conf:
166
+ #{config[:data_dir]}/pgpool/pgpool.conf
167
+
168
+ * Start pgpool-II:
169
+ $ prestogres -D "#{config[:data_dir]}" pgpool
170
+ (stop> prestogres -D "#{config[:data_dir]}" pgpool stop)
171
+
172
+ * Start PostgreSQL:
173
+ $ prestogres -D "#{config[:data_dir]}" pg_ctl start
174
+ (stop> prestogres -D "#{config[:data_dir]}" pg_ctl stop)
175
+
176
+ * Connect to pgpool-II:
177
+ $ psql -h localhost -p #{setup_params[:port]} -U pg postgres
178
+
179
+ If you run PostgreSQL on Mac OS X, you need to run following commands:
180
+
181
+ $ sudo sysctl -w kern.sysv.shmmax=1073741824
182
+ $ sudo sysctl -w kern.sysv.shmall=1073741824
183
+
184
+ You need to update 'presto_server' and 'presto_catalog' in
185
+ pgpool.conf at least.
186
+
187
+ EOF
188
+
189
+ when :passwd
190
+ if args.empty?
191
+ usage nil
192
+ end
193
+ unless config[:data_dir]
194
+ usage "-D option is required"
195
+ end
196
+
197
+ require "prestogres_config"
198
+ prefix = Prestogres::CONFIG["prefix"]
199
+ binary = File.join(prefix, "bin", 'pg_md5')
200
+
201
+ data_dir = config[:data_dir]
202
+ args = ["-f", File.join(data_dir, "pgpool", "pgpool.conf"), "-p", "-m", "-u"].concat(args)
203
+
204
+ puts "#{binary} #{args.join(' ')}"
205
+ system binary, *args
206
+
207
+ if $?.success?
208
+ puts "Successfully pdated pgpool/pool_passwd file. Edit pgpool/pool_passwd file directly to remove the entry."
209
+ else
210
+ exit $?.exitstatus
211
+ end
212
+
213
+ else
214
+ unless config[:data_dir]
215
+ usage "-D option is required"
216
+ end
217
+ require "prestogres_config"
218
+
219
+ if config[:command] == :pgpool
220
+ prefix = Prestogres::CONFIG["prefix"]
221
+ binary = File.join(prefix, "bin", config[:command].to_s)
222
+ else
223
+ # TODO configurable postgres install prefix (by ENV?)
224
+ binary = config[:command].to_s
225
+ end
226
+
227
+ pgsql_dir = File.expand_path File.join(File.dirname(__FILE__), "..", "pgsql")
228
+ ENV['PYTHONPATH'] = [pgsql_dir, ENV['PYTHONPATH']].compact.join(':')
229
+
230
+ data_dir = config[:data_dir]
231
+ case config[:command]
232
+ when :pgpool
233
+ args = ["--pcp-file", File.join(data_dir, "pgpool", "pcp.conf")].concat(args)
234
+ args = ["--hba-file", File.join(data_dir, "pgpool", "pool_hba.conf")].concat(args)
235
+ args = ["--config-file", File.join(data_dir, "pgpool", "pgpool.conf")].concat(args)
236
+ when :pg_ctl
237
+ args = ["-D", File.join(data_dir, "postgres")].concat(args)
238
+ args = ["-l", File.join(data_dir, "log", "postgres.log")].concat(args)
239
+ when :postgres
240
+ args = ["-D", File.join(data_dir, "postgres")].concat(args)
241
+ end
242
+
243
+ puts "PYTHONPATH=#{ENV['PYTHONPATH']}"
244
+ puts "#{binary} #{args.join(' ')}"
245
+
246
+ if Kernel.respond_to?(:exec)
247
+ exec binary, *args
248
+ else
249
+ system binary, *args
250
+ exit $?.exitstatus
251
+ end
252
+
253
+ end
254
+
@@ -0,0 +1,28 @@
1
+ # PCP Client Authentication Configuration File
2
+ # ============================================
3
+ #
4
+ # This file contains user ID and his password for pgpool
5
+ # communication manager authentication.
6
+ #
7
+ # Note that users defined here do not need to be PostgreSQL
8
+ # users. These users are authorized ONLY for pgpool
9
+ # communication manager.
10
+ #
11
+ # File Format
12
+ # ===========
13
+ #
14
+ # List one UserID and password on a single line. They must
15
+ # be concatenated together using ':' (colon) between them.
16
+ # No spaces or tabs are allowed anywhere in the line.
17
+ #
18
+ # Example:
19
+ # postgres:e8a48653851e28c69d0506508fb27fc5
20
+ #
21
+ # Be aware that there will be no spaces or tabs at the
22
+ # beginning of the line! although the above example looks
23
+ # like so.
24
+ #
25
+ # Lines beginning with '#' (pound) are comments and will
26
+ # be ignored. Again, no spaces or tabs allowed before '#'.
27
+
28
+ # USERID:MD5PASSWD
@@ -0,0 +1,678 @@
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 = 'localhost'
28
+ # Host name or IP address to listen on:
29
+ # '*' for all, '' for no TCP/IP connections
30
+ # (change requires restart)
31
+ port = <%= @config[:port] %>
32
+ # Port number
33
+ # (change requires restart)
34
+ socket_dir = '<%= @config[:unix_socket_directory] %>'
35
+ # Unix domain socket path
36
+ # The Debian package defaults to
37
+ # /var/run/postgresql
38
+ # (change requires restart)
39
+
40
+ # - Presto Settings -
41
+ presto_server = 'localhost:8080'
42
+ # Address of Presto server.
43
+ # You can overwrite this parameter depending
44
+ # on user, database, or client address using
45
+ # pool_hba.conf.
46
+ presto_catalog = 'native'
47
+ # Catalog name of Presto.
48
+ # You can overwrite this parameter depending
49
+ # on user, database, or client address using
50
+ # pool_hba.conf.
51
+ presto_schema = 'default'
52
+ # Default schema name of Presto.
53
+ # You can overwrite this parameter depending
54
+ # on user, database, or client address using
55
+ # pool_hba.conf.
56
+
57
+ # - pgpool Communication Manager Connection Settings -
58
+
59
+ pcp_port = 9898
60
+ # Port number for pcp
61
+ # (change requires restart)
62
+ pcp_socket_dir = '<%= @config[:unix_socket_directory] %>'
63
+ # Unix domain socket path for pcp
64
+ # The Debian package defaults to
65
+ # /var/run/postgresql
66
+ # (change requires restart)
67
+
68
+ # - Backend Connection Settings -
69
+
70
+ backend_hostname0 = '127.0.0.1'
71
+ # Host name or IP address to connect to for backend 0
72
+ backend_port0 = <%= @config[:backend_port] %>
73
+ # Port number for backend 0
74
+ backend_weight0 = 0
75
+ # Weight for backend 0 (only in load balancing mode)
76
+ #backend_data_directory0 = '/data'
77
+ # Data directory for backend 0
78
+ backend_flag0 = 'DISALLOW_TO_FAILOVER'
79
+ # Controls various backend behavior
80
+ # ALLOW_TO_FAILOVER or DISALLOW_TO_FAILOVER
81
+
82
+
83
+ # - Authentication -
84
+
85
+ enable_pool_hba = on
86
+ # Use pool_hba.conf for client authentication
87
+ pool_passwd = 'pool_passwd'
88
+ # File name of pool_passwd for md5 authentication.
89
+ # "" disables pool_passwd.
90
+ # (change requires restart)
91
+ authentication_timeout = 60
92
+ # Delay in seconds to complete client authentication
93
+ # 0 means no timeout.
94
+
95
+ # - SSL Connections -
96
+
97
+ ssl = off
98
+ # Enable SSL support
99
+ # (change requires restart)
100
+ #ssl_key = './server.key'
101
+ # Path to the SSL private key file
102
+ # (change requires restart)
103
+ #ssl_cert = './server.cert'
104
+ # Path to the SSL public certificate file
105
+ # (change requires restart)
106
+ #ssl_ca_cert = ''
107
+ # Path to a single PEM format file
108
+ # containing CA root certificate(s)
109
+ # (change requires restart)
110
+ #ssl_ca_cert_dir = ''
111
+ # Directory containing CA root certificate(s)
112
+ # (change requires restart)
113
+
114
+
115
+ #------------------------------------------------------------------------------
116
+ # POOLS
117
+ #------------------------------------------------------------------------------
118
+
119
+ # - Pool size -
120
+
121
+ num_init_children = 32
122
+ # Number of pools
123
+ # (change requires restart)
124
+ max_pool = 4
125
+ # Number of connections per pool
126
+ # (change requires restart)
127
+
128
+ # - Life time -
129
+
130
+ child_life_time = 300
131
+ # Pool exits after being idle for this many seconds
132
+ child_max_connections = 0
133
+ # Pool exits after receiving that many connections
134
+ # 0 means no exit
135
+ connection_life_time = 0
136
+ # Connection to backend closes after being idle for this many seconds
137
+ # 0 means no close
138
+ client_idle_limit = 0
139
+ # Client is disconnected after being idle for that many seconds
140
+ # (even inside an explicit transactions!)
141
+ # 0 means no disconnection
142
+
143
+
144
+ #------------------------------------------------------------------------------
145
+ # LOGS
146
+ #------------------------------------------------------------------------------
147
+
148
+ # - Where to log -
149
+
150
+ log_destination = 'stderr'
151
+ # Where to log
152
+ # Valid values are combinations of stderr,
153
+ # and syslog. Default to stderr.
154
+
155
+ # - What to log -
156
+
157
+ print_timestamp = on
158
+ # Print timestamp on each line
159
+ # (change requires restart)
160
+
161
+ log_connections = off
162
+ # Log connections
163
+ log_hostname = off
164
+ # Hostname will be shown in ps status
165
+ # and in logs if connections are logged
166
+ log_statement = off
167
+ # Log all statements
168
+ log_per_node_statement = off
169
+ # Log all statements
170
+ # with node and backend informations
171
+ log_standby_delay = 'none'
172
+ # Log standby delay
173
+ # Valid values are combinations of always,
174
+ # if_over_threshold, none
175
+
176
+ # - Syslog specific -
177
+
178
+ syslog_facility = 'LOCAL0'
179
+ # Syslog local facility. Default to LOCAL0
180
+ syslog_ident = 'pgpool'
181
+ # Syslog program identification string
182
+ # Default to 'pgpool'
183
+
184
+ # - Debug -
185
+
186
+ debug_level = 0
187
+ # Debug message verbosity level
188
+ # 0 means no message, 1 or more mean verbose
189
+
190
+
191
+ #------------------------------------------------------------------------------
192
+ # FILE LOCATIONS
193
+ #------------------------------------------------------------------------------
194
+
195
+ pid_file_name = '<%= @config[:pgpool_pid_file] %>'
196
+ # PID file name
197
+ # (change requires restart)
198
+ logdir = '<%= @config[:pgpool_status_dir] %>'
199
+ # Directory of pgPool status file
200
+ # (change requires restart)
201
+
202
+
203
+ #------------------------------------------------------------------------------
204
+ # CONNECTION POOLING
205
+ #------------------------------------------------------------------------------
206
+
207
+ connection_cache = on
208
+ # Activate connection pools
209
+ # (change requires restart)
210
+
211
+ # Semicolon separated list of queries
212
+ # to be issued at the end of a session
213
+ # The default is for 8.3 and later
214
+ reset_query_list = 'ABORT; DISCARD ALL'
215
+ # The following one is for 8.2 and before
216
+ #reset_query_list = 'ABORT; RESET ALL; SET SESSION AUTHORIZATION DEFAULT'
217
+
218
+
219
+ #------------------------------------------------------------------------------
220
+ # REPLICATION MODE
221
+ #------------------------------------------------------------------------------
222
+
223
+ replication_mode = off
224
+ # Activate replication mode
225
+ # (change requires restart)
226
+ replicate_select = off
227
+ # Replicate SELECT statements
228
+ # when in replication or parallel mode
229
+ # replicate_select is higher priority than
230
+ # load_balance_mode.
231
+
232
+ insert_lock = off
233
+ # Automatically locks a dummy row or a table
234
+ # with INSERT statements to keep SERIAL data
235
+ # consistency
236
+ # Without SERIAL, no lock will be issued
237
+ lobj_lock_table = ''
238
+ # When rewriting lo_creat command in
239
+ # replication mode, specify table name to
240
+ # lock
241
+
242
+ # - Degenerate handling -
243
+
244
+ replication_stop_on_mismatch = off
245
+ # On disagreement with the packet kind
246
+ # sent from backend, degenerate the node
247
+ # which is most likely "minority"
248
+ # If off, just force to exit this session
249
+
250
+ failover_if_affected_tuples_mismatch = off
251
+ # On disagreement with the number of affected
252
+ # tuples in UPDATE/DELETE queries, then
253
+ # degenerate the node which is most likely
254
+ # "minority".
255
+ # If off, just abort the transaction to
256
+ # keep the consistency
257
+
258
+
259
+ #------------------------------------------------------------------------------
260
+ # LOAD BALANCING MODE
261
+ #------------------------------------------------------------------------------
262
+
263
+ load_balance_mode = on
264
+ # Activate load balancing mode
265
+ # (change requires restart)
266
+ ignore_leading_white_space = on
267
+ # Ignore leading white spaces of each query
268
+ white_function_list = ''
269
+ # Comma separated list of function names
270
+ # that don't write to database
271
+ # Regexp are accepted
272
+ black_function_list = 'currval,lastval,nextval,setval,current_setting'
273
+ # Comma separated list of function names
274
+ # that write to database
275
+ # Regexp are accepted
276
+
277
+
278
+ #------------------------------------------------------------------------------
279
+ # MASTER/SLAVE MODE
280
+ #------------------------------------------------------------------------------
281
+
282
+ master_slave_mode = on
283
+ # Activate master/slave mode
284
+ # (change requires restart)
285
+ master_slave_sub_mode = 'slony'
286
+ # Master/slave sub mode
287
+ # Valid values are combinations slony or
288
+ # stream. Default is slony.
289
+ # (change requires restart)
290
+
291
+ # - Streaming -
292
+
293
+ sr_check_period = 0
294
+ # Streaming replication check period
295
+ # Disabled (0) by default
296
+ sr_check_user = 'nobody'
297
+ # Streaming replication check user
298
+ # This is neccessary even if you disable streaming
299
+ # replication delay check by sr_check_period = 0
300
+ sr_check_password = ''
301
+ # Password for streaming replication check user
302
+ delay_threshold = 0
303
+ # Threshold before not dispatching query to standby node
304
+ # Unit is in bytes
305
+ # Disabled (0) by default
306
+
307
+ # - Special commands -
308
+
309
+ follow_master_command = ''
310
+ # Executes this command after master failover
311
+ # Special values:
312
+ # %d = node id
313
+ # %h = host name
314
+ # %p = port number
315
+ # %D = database cluster path
316
+ # %m = new master node id
317
+ # %H = hostname of the new master node
318
+ # %M = old master node id
319
+ # %P = old primary node id
320
+ # %r = new master port number
321
+ # %R = new master database cluster path
322
+ # %% = '%' character
323
+
324
+
325
+ #------------------------------------------------------------------------------
326
+ # PARALLEL MODE
327
+ #------------------------------------------------------------------------------
328
+
329
+ parallel_mode = off
330
+ # Activates parallel query mode
331
+ # (change requires restart)
332
+ pgpool2_hostname = ''
333
+ # Set pgpool2 hostname
334
+ # (change requires restart)
335
+
336
+ # - System DB info -
337
+
338
+ #system_db_hostname = 'localhost'
339
+ # (change requires restart)
340
+ #system_db_port = 5432
341
+ # (change requires restart)
342
+ #system_db_dbname = 'pgpool'
343
+ # (change requires restart)
344
+ #system_db_schema = 'pgpool_catalog'
345
+ # (change requires restart)
346
+ #system_db_user = 'pgpool'
347
+ # (change requires restart)
348
+ #system_db_password = ''
349
+ # (change requires restart)
350
+
351
+
352
+ #------------------------------------------------------------------------------
353
+ # HEALTH CHECK
354
+ #------------------------------------------------------------------------------
355
+
356
+ health_check_period = 0
357
+ # Health check period
358
+ # Disabled (0) by default
359
+ health_check_timeout = 20
360
+ # Health check timeout
361
+ # 0 means no timeout
362
+ health_check_user = 'nobody'
363
+ # Health check user
364
+ health_check_password = ''
365
+ # Password for health check user
366
+ health_check_max_retries = 0
367
+ # Maximum number of times to retry a failed health check before giving up.
368
+ health_check_retry_delay = 1
369
+ # Amount of time to wait (in seconds) between retries.
370
+
371
+
372
+ #------------------------------------------------------------------------------
373
+ # FAILOVER AND FAILBACK
374
+ #------------------------------------------------------------------------------
375
+
376
+ failover_command = ''
377
+ # Executes this command at failover
378
+ # Special values:
379
+ # %d = node id
380
+ # %h = host name
381
+ # %p = port number
382
+ # %D = database cluster path
383
+ # %m = new master node id
384
+ # %H = hostname of the new master node
385
+ # %M = old master node id
386
+ # %P = old primary node id
387
+ # %r = new master port number
388
+ # %R = new master database cluster path
389
+
390
+ # %% = '%' character
391
+ failback_command = ''
392
+ # Executes this command at failback.
393
+ # Special values:
394
+ # %d = node id
395
+ # %h = host name
396
+ # %p = port number
397
+ # %D = database cluster path
398
+ # %m = new master node id
399
+ # %H = hostname of the new master node
400
+ # %M = old master node id
401
+ # %P = old primary node id
402
+ # %r = new master port number
403
+ # %R = new master database cluster path
404
+ # %% = '%' character
405
+
406
+ fail_over_on_backend_error = on
407
+ # Initiates failover when reading/writing to the
408
+ # backend communication socket fails
409
+ # If set to off, pgpool will report an
410
+ # error and disconnect the session.
411
+
412
+ search_primary_node_timeout = 10
413
+ # Timeout in seconds to search for the
414
+ # primary node when a failover occurs.
415
+ # 0 means no timeout, keep searching
416
+ # for a primary node forever.
417
+
418
+ #------------------------------------------------------------------------------
419
+ # ONLINE RECOVERY
420
+ #------------------------------------------------------------------------------
421
+
422
+ recovery_user = 'nobody'
423
+ # Online recovery user
424
+ recovery_password = ''
425
+ # Online recovery password
426
+ recovery_1st_stage_command = ''
427
+ # Executes a command in first stage
428
+ recovery_2nd_stage_command = ''
429
+ # Executes a command in second stage
430
+ recovery_timeout = 90
431
+ # Timeout in seconds to wait for the
432
+ # recovering node's postmaster to start up
433
+ # 0 means no wait
434
+ client_idle_limit_in_recovery = 0
435
+ # Client is disconnected after being idle
436
+ # for that many seconds in the second stage
437
+ # of online recovery
438
+ # 0 means no disconnection
439
+ # -1 means immediate disconnection
440
+
441
+
442
+ #------------------------------------------------------------------------------
443
+ # WATCHDOG
444
+ #------------------------------------------------------------------------------
445
+
446
+ # - Enabling -
447
+
448
+ use_watchdog = off
449
+ # Activates watchdog
450
+ # (change requires restart)
451
+
452
+ # -Connection to up stream servers -
453
+
454
+ trusted_servers = ''
455
+ # trusted server list which are used
456
+ # to confirm network connection
457
+ # (hostA,hostB,hostC,...)
458
+ # (change requires restart)
459
+ ping_path = '/bin'
460
+ # ping command path
461
+ # (change requires restart)
462
+
463
+ # - Watchdog communication Settings -
464
+
465
+ wd_hostname = ''
466
+ # Host name or IP address of this watchdog
467
+ # (change requires restart)
468
+ wd_port = 9000
469
+ # port number for watchdog service
470
+ # (change requires restart)
471
+ wd_authkey = ''
472
+ # Authentication key for watchdog communication
473
+ # (change requires restart)
474
+
475
+ # - Virtual IP control Setting -
476
+
477
+ delegate_IP = ''
478
+ # delegate IP address
479
+ # If this is empty, virtual IP never bring up.
480
+ # (change requires restart)
481
+ ifconfig_path = '/sbin'
482
+ # ifconfig command path
483
+ # (change requires restart)
484
+ if_up_cmd = 'ifconfig eth0:0 inet $_IP_$ netmask 255.255.255.0'
485
+ # startup delegate IP command
486
+ # (change requires restart)
487
+ if_down_cmd = 'ifconfig eth0:0 down'
488
+ # shutdown delegate IP command
489
+ # (change requires restart)
490
+
491
+ arping_path = '/usr/sbin' # arping command path
492
+ # (change requires restart)
493
+
494
+ arping_cmd = 'arping -U $_IP_$ -w 1'
495
+ # arping command
496
+ # (change requires restart)
497
+
498
+ # - Behaivor on escalation Setting -
499
+
500
+ clear_memqcache_on_escalation = on
501
+ # Clear all the query cache on shared memory
502
+ # when standby pgpool escalate to active pgpool
503
+ # (= virtual IP holder).
504
+ # This should be off if client connects to pgpool
505
+ # not using virtual IP.
506
+ # (change requires restart)
507
+ wd_escalation_command = ''
508
+ # Executes this command at escalation on new active pgpool.
509
+ # (change requires restart)
510
+
511
+ # - Lifecheck Setting -
512
+
513
+ # -- common --
514
+
515
+ wd_lifecheck_method = 'heartbeat'
516
+ # Method of watchdog lifecheck ('heartbeat' or 'query')
517
+ # (change requires restart)
518
+ wd_interval = 10
519
+ # lifecheck interval (sec) > 0
520
+ # (change requires restart)
521
+
522
+ # -- heartbeat mode --
523
+
524
+ wd_heartbeat_port = 9694
525
+ # Port number for receiving heartbeat signal
526
+ # (change requires restart)
527
+ wd_heartbeat_keepalive = 2
528
+ # Interval time of sending heartbeat signal (sec)
529
+ # (change requires restart)
530
+ wd_heartbeat_deadtime = 30
531
+ # Deadtime interval for heartbeat signal (sec)
532
+ # (change requires restart)
533
+ heartbeat_destination0 = 'host0_ip1'
534
+ # Host name or IP address of destination 0
535
+ # for sending heartbeat signal.
536
+ # (change requires restart)
537
+ heartbeat_destination_port0 = 9694
538
+ # Port number of destination 0 for sending
539
+ # heartbeat signal. Usually this is the
540
+ # same as wd_heartbeat_port.
541
+ # (change requires restart)
542
+ heartbeat_device0 = ''
543
+ # Name of NIC device (such like 'eth0')
544
+ # used for sending/receiving heartbeat
545
+ # signal to/from destination 0.
546
+ # This works only when this is not empty
547
+ # and pgpool has root privilege.
548
+ # (change requires restart)
549
+
550
+ #heartbeat_destination1 = 'host0_ip2'
551
+ #heartbeat_destination_port1 = 9694
552
+ #heartbeat_device1 = ''
553
+
554
+ # -- query mode --
555
+
556
+ wd_life_point = 3
557
+ # lifecheck retry times
558
+ # (change requires restart)
559
+ wd_lifecheck_query = 'SELECT 1'
560
+ # lifecheck query to pgpool from watchdog
561
+ # (change requires restart)
562
+ wd_lifecheck_dbname = 'template1'
563
+ # Database name connected for lifecheck
564
+ # (change requires restart)
565
+ wd_lifecheck_user = 'nobody'
566
+ # watchdog user monitoring pgpools in lifecheck
567
+ # (change requires restart)
568
+ wd_lifecheck_password = ''
569
+ # Password for watchdog user in lifecheck
570
+ # (change requires restart)
571
+
572
+ # - Other pgpool Connection Settings -
573
+
574
+ #other_pgpool_hostname0 = 'host0'
575
+ # Host name or IP address to connect to for other pgpool 0
576
+ # (change requires restart)
577
+ #other_pgpool_port0 = 5432
578
+ # Port number for othet pgpool 0
579
+ # (change requires restart)
580
+ #other_wd_port0 = 9000
581
+ # Port number for othet watchdog 0
582
+ # (change requires restart)
583
+ #other_pgpool_hostname1 = 'host1'
584
+ #other_pgpool_port1 = 5432
585
+ #other_wd_port1 = 9000
586
+
587
+
588
+ #------------------------------------------------------------------------------
589
+ # OTHERS
590
+ #------------------------------------------------------------------------------
591
+ relcache_expire = 1
592
+ # Life time of relation cache in seconds.
593
+ # 0 means no cache expiration(the default).
594
+ # The relation cache is used for cache the
595
+ # query result against PostgreSQL system
596
+ # catalog to obtain various information
597
+ # including table structures or if it's a
598
+ # temporary table or not. The cache is
599
+ # maintained in a pgpool child local memory
600
+ # and being kept as long as it survives.
601
+ # If someone modify the table by using
602
+ # ALTER TABLE or some such, the relcache is
603
+ # not consistent anymore.
604
+ # For this purpose, cache_expiration
605
+ # controls the life time of the cache.
606
+
607
+ relcache_size = 256
608
+ # Number of relation cache
609
+ # entry. If you see frequently:
610
+ # "pool_search_relcache: cache replacement happend"
611
+ # in the pgpool log, you might want to increate this number.
612
+
613
+ check_temp_table = off
614
+ # If on, enable temporary table check in SELECT statements.
615
+ # This initiates queries against system catalog of primary/master
616
+ # thus increases load of master.
617
+ # If you are absolutely sure that your system never uses temporary tables
618
+ # and you want to save access to primary/master, you could turn this off.
619
+ # Default is on.
620
+
621
+
622
+ #------------------------------------------------------------------------------
623
+ # ON MEMORY QUERY MEMORY CACHE
624
+ #------------------------------------------------------------------------------
625
+ memory_cache_enabled = off
626
+ # If on, use the memory cache functionality, off by default
627
+ memqcache_method = 'shmem'
628
+ # Cache storage method. either 'shmem'(shared memory) or
629
+ # 'memcached'. 'shmem' by default
630
+ # (change requires restart)
631
+ memqcache_memcached_host = 'localhost'
632
+ # Memcached host name or IP address. Mandatory if
633
+ # memqcache_method = 'memcached'.
634
+ # Defaults to localhost.
635
+ # (change requires restart)
636
+ memqcache_memcached_port = 11211
637
+ # Memcached port number. Mondatory if memqcache_method = 'memcached'.
638
+ # Defaults to 11211.
639
+ # (change requires restart)
640
+ memqcache_total_size = 67108864
641
+ # Total memory size in bytes for storing memory cache.
642
+ # Mandatory if memqcache_method = 'shmem'.
643
+ # Defaults to 64MB.
644
+ # (change requires restart)
645
+ memqcache_max_num_cache = 1000000
646
+ # Total number of cache entries. Mandatory
647
+ # if memqcache_method = 'shmem'.
648
+ # Each cache entry consumes 48 bytes on shared memory.
649
+ # Defaults to 1,000,000(45.8MB).
650
+ # (change requires restart)
651
+ memqcache_expire = 0
652
+ # Memory cache entry life time specified in seconds.
653
+ # 0 means infinite life time. 0 by default.
654
+ # (change requires restart)
655
+ memqcache_auto_cache_invalidation = on
656
+ # If on, invalidation of query cache is triggered by corresponding
657
+ # DDL/DML/DCL(and memqcache_expire). If off, it is only triggered
658
+ # by memqcache_expire. on by default.
659
+ # (change requires restart)
660
+ memqcache_maxcache = 409600
661
+ # Maximum SELECT result size in bytes.
662
+ # Must be smaller than memqcache_cache_block_size. Defaults to 400KB.
663
+ # (change requires restart)
664
+ memqcache_cache_block_size = 1048576
665
+ # Cache block size in bytes. Mandatory if memqcache_method = 'shmem'.
666
+ # Defaults to 1MB.
667
+ # (change requires restart)
668
+ memqcache_oiddir = '/var/log/pgpool/oiddir'
669
+ # Temporary work directory to record table oids
670
+ # (change requires restart)
671
+ white_memqcache_table_list = ''
672
+ # Comma separated list of table names to memcache
673
+ # that don't write to database
674
+ # Regexp are accepted
675
+ black_memqcache_table_list = ''
676
+ # Comma separated list of table names not to memcache
677
+ # that don't write to database
678
+ # Regexp are accepted