prestogres 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -0,0 +1,273 @@
1
+ /*------------------------------------------------------------------------
2
+ * PostgreSQL manual configuration settings
3
+ *
4
+ * This file contains various configuration symbols and limits. In
5
+ * all cases, changing them is only useful in very rare situations or
6
+ * for developers. If you edit any of these, be sure to do a *full*
7
+ * rebuild (and an initdb if noted).
8
+ *
9
+ * Portions Copyright (c) 2003-2013, PgPool Global Development Group
10
+ * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group
11
+ * Portions Copyright (c) 1994, Regents of the University of California
12
+ *
13
+ * src/include/pg_config_manual.h
14
+ *------------------------------------------------------------------------
15
+ */
16
+
17
+ #if 0
18
+ /*
19
+ * Maximum length for identifiers (e.g. table names, column names,
20
+ * function names). Names actually are limited to one less byte than this,
21
+ * because the length must include a trailing zero byte.
22
+ *
23
+ * Changing this requires an initdb.
24
+ */
25
+ #define NAMEDATALEN 64
26
+
27
+ /*
28
+ * Maximum number of arguments to a function.
29
+ *
30
+ * The minimum value is 8 (GIN indexes use 8-argument support functions).
31
+ * The maximum possible value is around 600 (limited by index tuple size in
32
+ * pg_proc's index; BLCKSZ larger than 8K would allow more). Values larger
33
+ * than needed will waste memory and processing time, but do not directly
34
+ * cost disk space.
35
+ *
36
+ * Changing this does not require an initdb, but it does require a full
37
+ * backend recompile (including any user-defined C functions).
38
+ */
39
+ #define FUNC_MAX_ARGS 100
40
+
41
+ /*
42
+ * Maximum number of columns in an index. There is little point in making
43
+ * this anything but a multiple of 32, because the main cost is associated
44
+ * with index tuple header size (see access/itup.h).
45
+ *
46
+ * Changing this requires an initdb.
47
+ */
48
+ #define INDEX_MAX_KEYS 32
49
+
50
+ /*
51
+ * Set the upper and lower bounds of sequence values.
52
+ */
53
+ #define SEQ_MAXVALUE INT64CONST(0x7FFFFFFFFFFFFFFF)
54
+ #define SEQ_MINVALUE (-SEQ_MAXVALUE)
55
+
56
+ /*
57
+ * Number of spare LWLocks to allocate for user-defined add-on code.
58
+ */
59
+ #define NUM_USER_DEFINED_LWLOCKS 4
60
+
61
+ /*
62
+ * Define this if you want to allow the lo_import and lo_export SQL
63
+ * functions to be executed by ordinary users. By default these
64
+ * functions are only available to the Postgres superuser. CAUTION:
65
+ * These functions are SECURITY HOLES since they can read and write
66
+ * any file that the PostgreSQL server has permission to access. If
67
+ * you turn this on, don't say we didn't warn you.
68
+ */
69
+ /* #define ALLOW_DANGEROUS_LO_FUNCTIONS */
70
+
71
+ /*
72
+ * MAXPGPATH: standard size of a pathname buffer in PostgreSQL (hence,
73
+ * maximum usable pathname length is one less).
74
+ *
75
+ * We'd use a standard system header symbol for this, if there weren't
76
+ * so many to choose from: MAXPATHLEN, MAX_PATH, PATH_MAX are all
77
+ * defined by different "standards", and often have different values
78
+ * on the same platform! So we just punt and use a reasonably
79
+ * generous setting here.
80
+ */
81
+ #define MAXPGPATH 1024
82
+
83
+ /*
84
+ * PG_SOMAXCONN: maximum accept-queue length limit passed to
85
+ * listen(2). You'd think we should use SOMAXCONN from
86
+ * <sys/socket.h>, but on many systems that symbol is much smaller
87
+ * than the kernel's actual limit. In any case, this symbol need be
88
+ * twiddled only if you have a kernel that refuses large limit values,
89
+ * rather than silently reducing the value to what it can handle
90
+ * (which is what most if not all Unixen do).
91
+ */
92
+ #define PG_SOMAXCONN 10000
93
+
94
+ /*
95
+ * You can try changing this if you have a machine with bytes of
96
+ * another size, but no guarantee...
97
+ */
98
+ #define BITS_PER_BYTE 8
99
+
100
+ /*
101
+ * Preferred alignment for disk I/O buffers. On some CPUs, copies between
102
+ * user space and kernel space are significantly faster if the user buffer
103
+ * is aligned on a larger-than-MAXALIGN boundary. Ideally this should be
104
+ * a platform-dependent value, but for now we just hard-wire it.
105
+ */
106
+ #define ALIGNOF_BUFFER 32
107
+
108
+ /*
109
+ * Disable UNIX sockets for certain operating systems.
110
+ */
111
+ #if defined(WIN32)
112
+ #undef HAVE_UNIX_SOCKETS
113
+ #endif
114
+
115
+ /*
116
+ * Define this if your operating system supports link()
117
+ */
118
+ #if !defined(WIN32) && !defined(__CYGWIN__)
119
+ #define HAVE_WORKING_LINK 1
120
+ #endif
121
+
122
+ /*
123
+ * USE_POSIX_FADVISE controls whether Postgres will attempt to use the
124
+ * posix_fadvise() kernel call. Usually the automatic configure tests are
125
+ * sufficient, but some older Linux distributions had broken versions of
126
+ * posix_fadvise(). If necessary you can remove the #define here.
127
+ */
128
+ #if HAVE_DECL_POSIX_FADVISE && defined(HAVE_POSIX_FADVISE)
129
+ #define USE_POSIX_FADVISE
130
+ #endif
131
+
132
+ /*
133
+ * USE_PREFETCH code should be compiled only if we have a way to implement
134
+ * prefetching. (This is decoupled from USE_POSIX_FADVISE because there
135
+ * might in future be support for alternative low-level prefetch APIs.)
136
+ */
137
+ #ifdef USE_POSIX_FADVISE
138
+ #define USE_PREFETCH
139
+ #endif
140
+
141
+ /*
142
+ * This is the default directory in which AF_UNIX socket files are
143
+ * placed. Caution: changing this risks breaking your existing client
144
+ * applications, which are likely to continue to look in the old
145
+ * directory. But if you just hate the idea of sockets in /tmp,
146
+ * here's where to twiddle it. You can also override this at runtime
147
+ * with the postmaster's -k switch.
148
+ */
149
+ #define DEFAULT_PGSOCKET_DIR "/tmp"
150
+
151
+ /*
152
+ * The random() function is expected to yield values between 0 and
153
+ * MAX_RANDOM_VALUE. Currently, all known implementations yield
154
+ * 0..2^31-1, so we just hardwire this constant. We could do a
155
+ * configure test if it proves to be necessary. CAUTION: Think not to
156
+ * replace this with RAND_MAX. RAND_MAX defines the maximum value of
157
+ * the older rand() function, which is often different from --- and
158
+ * considerably inferior to --- random().
159
+ */
160
+ #define MAX_RANDOM_VALUE (0x7FFFFFFF)
161
+ #endif
162
+
163
+ /*
164
+ * Set the format style used by gcc to check printf type functions. We really
165
+ * want the "gnu_printf" style set, which includes what glibc uses, such
166
+ * as %m for error strings and %lld for 64 bit long longs. But not all gcc
167
+ * compilers are known to support it, so we just use "printf" which all
168
+ * gcc versions alive are known to support, except on Windows where
169
+ * using "gnu_printf" style makes a dramatic difference. Maybe someday
170
+ * we'll have a configure test for this, if we ever discover use of more
171
+ * variants to be necessary.
172
+ */
173
+ #ifdef WIN32
174
+ #define PG_PRINTF_ATTRIBUTE gnu_printf
175
+ #else
176
+ #define PG_PRINTF_ATTRIBUTE printf
177
+ #endif
178
+
179
+ #if 0
180
+ /*
181
+ * On PPC machines, decide whether to use the mutex hint bit in LWARX
182
+ * instructions. Setting the hint bit will slightly improve spinlock
183
+ * performance on POWER6 and later machines, but does nothing before that,
184
+ * and will result in illegal-instruction failures on some pre-POWER4
185
+ * machines. By default we use the hint bit when building for 64-bit PPC,
186
+ * which should be safe in nearly all cases. You might want to override
187
+ * this if you are building 32-bit code for a known-recent PPC machine.
188
+ */
189
+ #ifdef HAVE_PPC_LWARX_MUTEX_HINT /* must have assembler support in any case */
190
+ #if defined(__ppc64__) || defined(__powerpc64__)
191
+ #define USE_PPC_LWARX_MUTEX_HINT
192
+ #endif
193
+ #endif
194
+
195
+ /*
196
+ * On PPC machines, decide whether to use LWSYNC instructions in place of
197
+ * ISYNC and SYNC. This provides slightly better performance, but will
198
+ * result in illegal-instruction failures on some pre-POWER4 machines.
199
+ * By default we use LWSYNC when building for 64-bit PPC, which should be
200
+ * safe in nearly all cases.
201
+ */
202
+ #if defined(__ppc64__) || defined(__powerpc64__)
203
+ #define USE_PPC_LWSYNC
204
+ #endif
205
+
206
+ /*
207
+ *------------------------------------------------------------------------
208
+ * The following symbols are for enabling debugging code, not for
209
+ * controlling user-visible features or resource limits.
210
+ *------------------------------------------------------------------------
211
+ */
212
+
213
+ /*
214
+ * Define this to cause pfree()'d memory to be cleared immediately, to
215
+ * facilitate catching bugs that refer to already-freed values.
216
+ * Right now, this gets defined automatically if --enable-cassert.
217
+ */
218
+ #ifdef USE_ASSERT_CHECKING
219
+ #define CLOBBER_FREED_MEMORY
220
+ #endif
221
+
222
+ /*
223
+ * Define this to check memory allocation errors (scribbling on more
224
+ * bytes than were allocated). Right now, this gets defined
225
+ * automatically if --enable-cassert.
226
+ */
227
+ #ifdef USE_ASSERT_CHECKING
228
+ #define MEMORY_CONTEXT_CHECKING
229
+ #endif
230
+
231
+ /*
232
+ * Define this to cause palloc()'d memory to be filled with random data, to
233
+ * facilitate catching code that depends on the contents of uninitialized
234
+ * memory. Caution: this is horrendously expensive.
235
+ */
236
+ /* #define RANDOMIZE_ALLOCATED_MEMORY */
237
+
238
+ /*
239
+ * Define this to force all parse and plan trees to be passed through
240
+ * copyObject(), to facilitate catching errors and omissions in
241
+ * copyObject().
242
+ */
243
+ /* #define COPY_PARSE_PLAN_TREES */
244
+
245
+ /*
246
+ * Enable debugging print statements for lock-related operations.
247
+ */
248
+ /* #define LOCK_DEBUG */
249
+
250
+ /*
251
+ * Enable debugging print statements for WAL-related operations; see
252
+ * also the wal_debug GUC var.
253
+ */
254
+ /* #define WAL_DEBUG */
255
+
256
+ /*
257
+ * Enable tracing of resource consumption during sort operations;
258
+ * see also the trace_sort GUC var. For 8.1 this is enabled by default.
259
+ */
260
+ #define TRACE_SORT 1
261
+
262
+ /*
263
+ * Enable tracing of syncscan operations (see also the trace_syncscan GUC var).
264
+ */
265
+ /* #define TRACE_SYNCSCAN */
266
+
267
+ /*
268
+ * Other debug #defines (documentation, anyone?)
269
+ */
270
+ /* #define HEAPDEBUGALL */
271
+ /* #define ACLDEBUG */
272
+ /* #define RTDEBUG */
273
+ #endif
@@ -0,0 +1,352 @@
1
+ /*-------------------------------------------------------------------------
2
+ *
3
+ * pg_list.h
4
+ * interface for PostgreSQL generic linked list package
5
+ *
6
+ * This package implements singly-linked homogeneous lists.
7
+ *
8
+ * It is important to have constant-time length, append, and prepend
9
+ * operations. To achieve this, we deal with two distinct data
10
+ * structures:
11
+ *
12
+ * 1. A set of "list cells": each cell contains a data field and
13
+ * a link to the next cell in the list or NULL.
14
+ * 2. A single structure containing metadata about the list: the
15
+ * type of the list, pointers to the head and tail cells, and
16
+ * the length of the list.
17
+ *
18
+ * We support three types of lists:
19
+ *
20
+ * T_List: lists of pointers
21
+ * (in practice usually pointers to Nodes, but not always;
22
+ * declared as "void *" to minimize casting annoyances)
23
+ * T_IntList: lists of integers
24
+ * T_OidList: lists of Oids
25
+ *
26
+ * (At the moment, ints and Oids are the same size, but they may not
27
+ * always be so; try to be careful to maintain the distinction.)
28
+ *
29
+ * There is also limited support for lists of TransactionIds; since these
30
+ * are used in only one or two places, we don't provide a full implementation,
31
+ * but map them onto Oid lists. This effectively assumes that TransactionId
32
+ * is no wider than Oid and both are unsigned types.
33
+ *
34
+ *
35
+ * Portions Copyright (c) 2003-2013, PgPool Global Development Group
36
+ * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group
37
+ * Portions Copyright (c) 1994, Regents of the University of California
38
+ *
39
+ * src/include/nodes/pg_list.h
40
+ *
41
+ *-------------------------------------------------------------------------
42
+ */
43
+ #ifndef PG_LIST_H
44
+ #define PG_LIST_H
45
+
46
+ #include <stdio.h>
47
+ #include "pool_parser.h"
48
+ #include "nodes.h"
49
+
50
+
51
+ typedef struct ListCell ListCell;
52
+
53
+ typedef struct List
54
+ {
55
+ NodeTag type; /* T_List, T_IntList, or T_OidList */
56
+ int length;
57
+ ListCell *head;
58
+ ListCell *tail;
59
+ } List;
60
+
61
+ struct ListCell
62
+ {
63
+ union
64
+ {
65
+ void *ptr_value;
66
+ int int_value;
67
+ Oid oid_value;
68
+ } data;
69
+ ListCell *next;
70
+ };
71
+
72
+ /*
73
+ * The *only* valid representation of an empty list is NIL; in other
74
+ * words, a non-NIL list is guaranteed to have length >= 1 and
75
+ * head/tail != NULL
76
+ */
77
+ #define NIL ((List *) NULL)
78
+
79
+ /*
80
+ * These routines are used frequently. However, we can't implement
81
+ * them as macros, since we want to avoid double-evaluation of macro
82
+ * arguments. Therefore, we implement them using GCC inline functions,
83
+ * and as regular functions with non-GCC compilers.
84
+ */
85
+ #ifdef __GNUC__
86
+
87
+ static __inline__ ListCell *
88
+ list_head(const List *l)
89
+ {
90
+ return l ? l->head : NULL;
91
+ }
92
+
93
+ static __inline__ ListCell *
94
+ list_tail(List *l)
95
+ {
96
+ return l ? l->tail : NULL;
97
+ }
98
+
99
+ static __inline__ int
100
+ list_length(List *l)
101
+ {
102
+ return l ? l->length : 0;
103
+ }
104
+ #else
105
+
106
+ extern ListCell *list_head(const List *l);
107
+ extern ListCell *list_tail(List *l);
108
+ extern int list_length(const List *l);
109
+ #endif /* __GNUC__ */
110
+
111
+ /*
112
+ * NB: There is an unfortunate legacy from a previous incarnation of
113
+ * the List API: the macro lfirst() was used to mean "the data in this
114
+ * cons cell". To avoid changing every usage of lfirst(), that meaning
115
+ * has been kept. As a result, lfirst() takes a ListCell and returns
116
+ * the data it contains; to get the data in the first cell of a
117
+ * List, use linitial(). Worse, lsecond() is more closely related to
118
+ * linitial() than lfirst(): given a List, lsecond() returns the data
119
+ * in the second cons cell.
120
+ */
121
+
122
+ #define lnext(lc) ((lc)->next)
123
+ #define lfirst(lc) ((lc)->data.ptr_value)
124
+ #define lfirst_int(lc) ((lc)->data.int_value)
125
+ #define lfirst_oid(lc) ((lc)->data.oid_value)
126
+
127
+ #define linitial(l) lfirst(list_head(l))
128
+ #define linitial_int(l) lfirst_int(list_head(l))
129
+ #define linitial_oid(l) lfirst_oid(list_head(l))
130
+
131
+ #define lsecond(l) lfirst(lnext(list_head(l)))
132
+ #define lsecond_int(l) lfirst_int(lnext(list_head(l)))
133
+ #define lsecond_oid(l) lfirst_oid(lnext(list_head(l)))
134
+
135
+ #define lthird(l) lfirst(lnext(lnext(list_head(l))))
136
+ #define lthird_int(l) lfirst_int(lnext(lnext(list_head(l))))
137
+ #define lthird_oid(l) lfirst_oid(lnext(lnext(list_head(l))))
138
+
139
+ #define lfourth(l) lfirst(lnext(lnext(lnext(list_head(l)))))
140
+ #define lfourth_int(l) lfirst_int(lnext(lnext(lnext(list_head(l)))))
141
+ #define lfourth_oid(l) lfirst_oid(lnext(lnext(lnext(list_head(l)))))
142
+
143
+ #define llast(l) lfirst(list_tail(l))
144
+ #define llast_int(l) lfirst_int(list_tail(l))
145
+ #define llast_oid(l) lfirst_oid(list_tail(l))
146
+
147
+ /*
148
+ * Convenience macros for building fixed-length lists
149
+ */
150
+ #define list_make1(x1) lcons(x1, NIL)
151
+ #define list_make2(x1,x2) lcons(x1, list_make1(x2))
152
+ #define list_make3(x1,x2,x3) lcons(x1, list_make2(x2, x3))
153
+ #define list_make4(x1,x2,x3,x4) lcons(x1, list_make3(x2, x3, x4))
154
+
155
+ #define list_make1_int(x1) lcons_int(x1, NIL)
156
+ #define list_make2_int(x1,x2) lcons_int(x1, list_make1_int(x2))
157
+ #define list_make3_int(x1,x2,x3) lcons_int(x1, list_make2_int(x2, x3))
158
+ #define list_make4_int(x1,x2,x3,x4) lcons_int(x1, list_make3_int(x2, x3, x4))
159
+
160
+ #define list_make1_oid(x1) lcons_oid(x1, NIL)
161
+ #define list_make2_oid(x1,x2) lcons_oid(x1, list_make1_oid(x2))
162
+ #define list_make3_oid(x1,x2,x3) lcons_oid(x1, list_make2_oid(x2, x3))
163
+ #define list_make4_oid(x1,x2,x3,x4) lcons_oid(x1, list_make3_oid(x2, x3, x4))
164
+
165
+ /*
166
+ * Limited support for lists of TransactionIds, mapped onto lists of Oids
167
+ */
168
+ #define lfirst_xid(lc) ((TransactionId) lfirst_oid(lc))
169
+ #define lappend_xid(list, datum) lappend_oid(list, (Oid) (datum))
170
+
171
+ /*
172
+ * foreach -
173
+ * a convenience macro which loops through the list
174
+ */
175
+ #define foreach(cell, l) \
176
+ for ((cell) = list_head(l); (cell) != NULL; (cell) = lnext(cell))
177
+
178
+ /*
179
+ * for_each_cell -
180
+ * a convenience macro which loops through a list starting from a
181
+ * specified cell
182
+ */
183
+ #define for_each_cell(cell, initcell) \
184
+ for ((cell) = (initcell); (cell) != NULL; (cell) = lnext(cell))
185
+
186
+ /*
187
+ * forboth -
188
+ * a convenience macro for advancing through two linked lists
189
+ * simultaneously. This macro loops through both lists at the same
190
+ * time, stopping when either list runs out of elements. Depending
191
+ * on the requirements of the call site, it may also be wise to
192
+ * assert that the lengths of the two lists are equal.
193
+ */
194
+ #define forboth(cell1, list1, cell2, list2) \
195
+ for ((cell1) = list_head(list1), (cell2) = list_head(list2); \
196
+ (cell1) != NULL && (cell2) != NULL; \
197
+ (cell1) = lnext(cell1), (cell2) = lnext(cell2))
198
+
199
+ /*
200
+ * forthree -
201
+ * the same for three lists
202
+ */
203
+ #define forthree(cell1, list1, cell2, list2, cell3, list3) \
204
+ for ((cell1) = list_head(list1), (cell2) = list_head(list2), (cell3) = list_head(list3); \
205
+ (cell1) != NULL && (cell2) != NULL && (cell3) != NULL; \
206
+ (cell1) = lnext(cell1), (cell2) = lnext(cell2), (cell3) = lnext(cell3))
207
+
208
+ /*
209
+ * forthree -
210
+ * the same for three lists
211
+ */
212
+ #define forthree(cell1, list1, cell2, list2, cell3, list3) \
213
+ for ((cell1) = list_head(list1), (cell2) = list_head(list2), (cell3) = list_head(list3); \
214
+ (cell1) != NULL && (cell2) != NULL && (cell3) != NULL; \
215
+ (cell1) = lnext(cell1), (cell2) = lnext(cell2), (cell3) = lnext(cell3))
216
+
217
+ /*
218
+ * forthree -
219
+ * the same for three lists
220
+ */
221
+ #define forthree(cell1, list1, cell2, list2, cell3, list3) \
222
+ for ((cell1) = list_head(list1), (cell2) = list_head(list2), (cell3) = list_head(list3); \
223
+ (cell1) != NULL && (cell2) != NULL && (cell3) != NULL; \
224
+ (cell1) = lnext(cell1), (cell2) = lnext(cell2), (cell3) = lnext(cell3))
225
+
226
+ extern List *lappend(List *list, void *datum);
227
+ extern List *lappend_int(List *list, int datum);
228
+ extern List *lappend_oid(List *list, Oid datum);
229
+
230
+ extern ListCell *lappend_cell(List *list, ListCell *prev, void *datum);
231
+ extern ListCell *lappend_cell_int(List *list, ListCell *prev, int datum);
232
+ extern ListCell *lappend_cell_oid(List *list, ListCell *prev, Oid datum);
233
+
234
+ extern List *lcons(void *datum, List *list);
235
+ extern List *lcons_int(int datum, List *list);
236
+ extern List *lcons_oid(Oid datum, List *list);
237
+
238
+ extern List *list_concat(List *list1, List *list2);
239
+ extern List *list_truncate(List *list, int new_size);
240
+
241
+ extern void *list_nth(const List *list, int n);
242
+ extern int list_nth_int(const List *list, int n);
243
+ extern Oid list_nth_oid(const List *list, int n);
244
+
245
+ extern bool list_member(const List *list, const void *datum);
246
+ extern bool list_member_ptr(const List *list, const void *datum);
247
+ extern bool list_member_int(const List *list, int datum);
248
+ extern bool list_member_oid(const List *list, Oid datum);
249
+
250
+ extern List *list_delete(List *list, void *datum);
251
+ extern List *list_delete_ptr(List *list, void *datum);
252
+ extern List *list_delete_int(List *list, int datum);
253
+ extern List *list_delete_oid(List *list, Oid datum);
254
+ extern List *list_delete_first(List *list);
255
+ extern List *list_delete_cell(List *list, ListCell *cell, ListCell *prev);
256
+
257
+ extern List *list_union(const List *list1, const List *list2);
258
+ extern List *list_union_ptr(const List *list1, const List *list2);
259
+ extern List *list_union_int(const List *list1, const List *list2);
260
+ extern List *list_union_oid(const List *list1, const List *list2);
261
+
262
+ extern List *list_difference(const List *list1, const List *list2);
263
+ extern List *list_difference_ptr(const List *list1, const List *list2);
264
+ extern List *list_difference_int(const List *list1, const List *list2);
265
+ extern List *list_difference_oid(const List *list1, const List *list2);
266
+
267
+ extern List *list_append_unique(List *list, void *datum);
268
+ extern List *list_append_unique_ptr(List *list, void *datum);
269
+ extern List *list_append_unique_int(List *list, int datum);
270
+ extern List *list_append_unique_oid(List *list, Oid datum);
271
+
272
+ extern List *list_concat_unique(List *list1, List *list2);
273
+ extern List *list_concat_unique_ptr(List *list1, List *list2);
274
+ extern List *list_concat_unique_int(List *list1, List *list2);
275
+ extern List *list_concat_unique_oid(List *list1, List *list2);
276
+
277
+ extern void list_free(List *list);
278
+ extern void list_free_deep(List *list);
279
+
280
+ extern List *list_copy(const List *list);
281
+ extern List *list_copy_tail(const List *list, int nskip);
282
+
283
+ /*
284
+ * To ease migration to the new list API, a set of compatibility
285
+ * macros are provided that reduce the impact of the list API changes
286
+ * as far as possible. Until client code has been rewritten to use the
287
+ * new list API, the ENABLE_LIST_COMPAT symbol can be defined before
288
+ * including pg_list.h
289
+ */
290
+ #ifdef ENABLE_LIST_COMPAT
291
+
292
+ #define lfirsti(lc) lfirst_int(lc)
293
+ #define lfirsto(lc) lfirst_oid(lc)
294
+
295
+ #define makeList1(x1) list_make1(x1)
296
+ #define makeList2(x1, x2) list_make2(x1, x2)
297
+ #define makeList3(x1, x2, x3) list_make3(x1, x2, x3)
298
+ #define makeList4(x1, x2, x3, x4) list_make4(x1, x2, x3, x4)
299
+
300
+ #define makeListi1(x1) list_make1_int(x1)
301
+ #define makeListi2(x1, x2) list_make2_int(x1, x2)
302
+
303
+ #define makeListo1(x1) list_make1_oid(x1)
304
+ #define makeListo2(x1, x2) list_make2_oid(x1, x2)
305
+
306
+ #define lconsi(datum, list) lcons_int(datum, list)
307
+ #define lconso(datum, list) lcons_oid(datum, list)
308
+
309
+ #define lappendi(list, datum) lappend_int(list, datum)
310
+ #define lappendo(list, datum) lappend_oid(list, datum)
311
+
312
+ #define nconc(l1, l2) list_concat(l1, l2)
313
+
314
+ #define nth(n, list) list_nth(list, n)
315
+
316
+ #define member(datum, list) list_member(list, datum)
317
+ #define ptrMember(datum, list) list_member_ptr(list, datum)
318
+ #define intMember(datum, list) list_member_int(list, datum)
319
+ #define oidMember(datum, list) list_member_oid(list, datum)
320
+
321
+ /*
322
+ * Note that the old lremove() determined equality via pointer
323
+ * comparison, whereas the new list_delete() uses equal(); in order to
324
+ * keep the same behavior, we therefore need to map lremove() calls to
325
+ * list_delete_ptr() rather than list_delete()
326
+ */
327
+ #define lremove(elem, list) list_delete_ptr(list, elem)
328
+ #define LispRemove(elem, list) list_delete(list, elem)
329
+ #define lremovei(elem, list) list_delete_int(list, elem)
330
+ #define lremoveo(elem, list) list_delete_oid(list, elem)
331
+
332
+ #define ltruncate(n, list) list_truncate(list, n)
333
+
334
+ #define set_union(l1, l2) list_union(l1, l2)
335
+ #define set_uniono(l1, l2) list_union_oid(l1, l2)
336
+ #define set_ptrUnion(l1, l2) list_union_ptr(l1, l2)
337
+
338
+ #define set_difference(l1, l2) list_difference(l1, l2)
339
+ #define set_differenceo(l1, l2) list_difference_oid(l1, l2)
340
+ #define set_ptrDifference(l1, l2) list_difference_ptr(l1, l2)
341
+
342
+ #define equali(l1, l2) equal(l1, l2)
343
+ #define equalo(l1, l2) equal(l1, l2)
344
+
345
+ #define freeList(list) list_free(list)
346
+
347
+ #define listCopy(list) list_copy(list)
348
+
349
+ extern int length(List *list);
350
+ #endif /* ENABLE_LIST_COMPAT */
351
+
352
+ #endif /* PG_LIST_H */