src/modules/db_postgres/README
dbbb5df4
 postgres Module
 
 Greg Fausak
 
    August.net
 
 Edited by
 
 Greg Fausak
 
d55c6bd0
    Copyright © 2003 Greg Fausak
      __________________________________________________________________
dbbb5df4
 
    Table of Contents
 
d55c6bd0
    1. Admin Guide
dbbb5df4
 
d55c6bd0
         1. Overview
         2. Dependencies
dbbb5df4
 
d55c6bd0
               2.1. Kamailio Modules
               2.2. External Libraries or Applications
dbbb5df4
 
ba7961bb
         3. Parameters
dbbb5df4
 
d55c6bd0
               3.1. retries (integer)
6619c0d2
               3.2. timeout (integer)
               3.3. tcp_keepalive (integer)
bbb9c335
               3.4. lockset (integer)
4e8104be
               3.5. bytea_output_escape (integer)
dbbb5df4
 
ba7961bb
         4. Functions
dbbb5df4
 
    List of Examples
 
d55c6bd0
    1.1. Set retries parameter
6619c0d2
    1.2. Set timeout parameter
    1.3. Set tcp_keepalive parameter
bbb9c335
    1.4. Set lockset parameter
4e8104be
    1.5. Set bytea_output_escape parameter
dbbb5df4
 
d55c6bd0
 Chapter 1. Admin Guide
dbbb5df4
 
d55c6bd0
    Table of Contents
dbbb5df4
 
d55c6bd0
    1. Overview
    2. Dependencies
dbbb5df4
 
d55c6bd0
         2.1. Kamailio Modules
         2.2. External Libraries or Applications
dbbb5df4
 
ba7961bb
    3. Parameters
dbbb5df4
 
d55c6bd0
         3.1. retries (integer)
6619c0d2
         3.2. timeout (integer)
         3.3. tcp_keepalive (integer)
bbb9c335
         3.4. lockset (integer)
4e8104be
         3.5. bytea_output_escape (integer)
dbbb5df4
 
ba7961bb
    4. Functions
dbbb5df4
 
d55c6bd0
 1. Overview
dbbb5df4
 
d55c6bd0
    The module is an implementation of the internal DB API v1 and v2
    connector for PostgreSQL server. It has support for reconnecting when
    the connection is broken.
dbbb5df4
 
d55c6bd0
 2. Dependencies
dbbb5df4
 
d55c6bd0
    2.1. Kamailio Modules
    2.2. External Libraries or Applications
dbbb5df4
 
d55c6bd0
 2.1. Kamailio Modules
dbbb5df4
 
d55c6bd0
    The following modules must be loaded before this module:
      * No dependencies on other Kamailio modules.
dbbb5df4
 
d55c6bd0
 2.2. External Libraries or Applications
 
    The following libraries or applications must be installed before
    running Kamailio with this module loaded:
      * PostgreSQL library - e.g., libpq5.
      * PostgreSQL devel library - to compile the module (e.g., libpq-dev).
dbbb5df4
 
ba7961bb
 3. Parameters
dbbb5df4
 
d55c6bd0
    3.1. retries (integer)
6619c0d2
    3.2. timeout (integer)
    3.3. tcp_keepalive (integer)
bbb9c335
    3.4. lockset (integer)
4e8104be
    3.5. bytea_output_escape (integer)
dbbb5df4
 
d55c6bd0
 3.1. retries (integer)
dbbb5df4
 
8868e624
    How many retries to attempt to reconnect if connection to Postgres
d55c6bd0
    server becomes broken.
dbbb5df4
 
8868e624
    Default value is 2 (that means three attempts to submit the query,
    first will trigger the connection error and two more (the value of this
d55c6bd0
    parameter) after resetting the connection).
dbbb5df4
 
d55c6bd0
    Example 1.1. Set retries parameter
dbbb5df4
 ...
c5a51e42
 modparam("db_postgres", "retries", 3)
dbbb5df4
 ...
 
6619c0d2
 3.2. timeout (integer)
 
    Setting this variable to any value larger than zero (which is the
    default value) enables both a connection timeout and a query timeout.
    If a connection attempt or a query takes longer than this many seconds,
    the operation will be aborted and an error will be returned.
 
    Note that this timeout is applied to each underlying operation (i.e.
    for each connection attempt), so depending on circumstances and on the
    value of the “retries” variable, a single query from the SIP proxy's
    point of view can take longer than the “timeout”.
 
    Example 1.2. Set timeout parameter
 ...
 modparam("db_postgres", "timeout", 10)
 ...
 
 3.3. tcp_keepalive (integer)
 
    Enable the TCP keepalive timer and set the number of seconds the
    connection must be idle before to start sending keepalive packets.
    Defaults to zero, which disables TCP keepalive packets.
 
    Only supported on platforms which understand and support the
    “TCP_KEEPIDLE” socket option.
 
    Example 1.3. Set tcp_keepalive parameter
 ...
 modparam("db_postgres", "tcp_keepalive", 600)
 ...
 
bbb9c335
 3.4. lockset (integer)
 
    The value is used as power of two to compute the size of the lock set
    needed to implement the equivalent of REPLACE SQL statement.
 
    Default value is 4 (lock set size is 16).
 
    Example 1.4. Set lockset parameter
 ...
 modparam("db_postgres", "lockset", 6)
 ...
 
4e8104be
 3.5. bytea_output_escape (integer)
 
    Control if the module should request escaping the output for bytea
    fields.
 
    Default value is 1 (do the escape).
 
    Example 1.5. Set bytea_output_escape parameter
 ...
 modparam("db_postgres", "bytea_output_escape", 0)
 ...
 
ba7961bb
 4. Functions
dbbb5df4
 
d55c6bd0
    NONE