README 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. postgres Module
  2. Greg Fausak
  3. August.net
  4. Edited by
  5. Greg Fausak
  6. Copyright © 2003 Greg Fausak
  7. __________________________________________________________________
  8. Table of Contents
  9. 1. Admin Guide
  10. 1. Overview
  11. 2. Dependencies
  12. 2.1. Kamailio Modules
  13. 2.2. External Libraries or Applications
  14. 3. Parameters
  15. 3.1. retries (integer)
  16. 3.2. timeout (integer)
  17. 3.3. tcp_keepalive (integer)
  18. 4. Functions
  19. List of Examples
  20. 1.1. Set retries parameter
  21. 1.2. Set timeout parameter
  22. 1.3. Set tcp_keepalive parameter
  23. Chapter 1. Admin Guide
  24. Table of Contents
  25. 1. Overview
  26. 2. Dependencies
  27. 2.1. Kamailio Modules
  28. 2.2. External Libraries or Applications
  29. 3. Parameters
  30. 3.1. retries (integer)
  31. 3.2. timeout (integer)
  32. 3.3. tcp_keepalive (integer)
  33. 4. Functions
  34. 1. Overview
  35. The module is an implementation of the internal DB API v1 and v2
  36. connector for PostgreSQL server. It has support for reconnecting when
  37. the connection is broken.
  38. 2. Dependencies
  39. 2.1. Kamailio Modules
  40. 2.2. External Libraries or Applications
  41. 2.1. Kamailio Modules
  42. The following modules must be loaded before this module:
  43. * No dependencies on other Kamailio modules.
  44. 2.2. External Libraries or Applications
  45. The following libraries or applications must be installed before
  46. running Kamailio with this module loaded:
  47. * PostgreSQL library - e.g., libpq5.
  48. * PostgreSQL devel library - to compile the module (e.g., libpq-dev).
  49. 3. Parameters
  50. 3.1. retries (integer)
  51. 3.2. timeout (integer)
  52. 3.3. tcp_keepalive (integer)
  53. 3.1. retries (integer)
  54. How many retries to attept to reconnect if connection to Postgres
  55. server becomes broken.
  56. Default value is 2 (that means three attepts to submit the query, first
  57. will triger the connection error and two more (the value of this
  58. parameter) after resetting the connection).
  59. Example 1.1. Set retries parameter
  60. ...
  61. modparam("db_postgres", "retries", 3)
  62. ...
  63. 3.2. timeout (integer)
  64. Setting this variable to any value larger than zero (which is the
  65. default value) enables both a connection timeout and a query timeout.
  66. If a connection attempt or a query takes longer than this many seconds,
  67. the operation will be aborted and an error will be returned.
  68. Note that this timeout is applied to each underlying operation (i.e.
  69. for each connection attempt), so depending on circumstances and on the
  70. value of the “retries” variable, a single query from the SIP proxy's
  71. point of view can take longer than the “timeout”.
  72. Example 1.2. Set timeout parameter
  73. ...
  74. modparam("db_postgres", "timeout", 10)
  75. ...
  76. 3.3. tcp_keepalive (integer)
  77. Enable the TCP keepalive timer and set the number of seconds the
  78. connection must be idle before to start sending keepalive packets.
  79. Defaults to zero, which disables TCP keepalive packets.
  80. Only supported on platforms which understand and support the
  81. “TCP_KEEPIDLE” socket option.
  82. Example 1.3. Set tcp_keepalive parameter
  83. ...
  84. modparam("db_postgres", "tcp_keepalive", 600)
  85. ...
  86. 4. Functions
  87. NONE