Daniel-Constantin Mierla 65d4dae702 db_postgres: memset vars to 0 to avoid using invalid values inside db_postgres_new_connection() 10 years ago
..
doc 6619c0d21d db_postgres: add new module vars "timeout" and "tcp_keepalive" 10 years ago
Makefile 17999042f6 module makefiles - remove SVN id and replace "example" with module name 10 years ago
README 6619c0d21d db_postgres: add new module vars "timeout" and "tcp_keepalive" 10 years ago
km_db_postgres.c 9e1ff4488a all: updated FSF address in GPL text 11 years ago
km_db_postgres.h 9e1ff4488a all: updated FSF address in GPL text 11 years ago
km_dbase.c 6619c0d21d db_postgres: add new module vars "timeout" and "tcp_keepalive" 10 years ago
km_dbase.h 9e1ff4488a all: updated FSF address in GPL text 11 years ago
km_pg_con.c 65d4dae702 db_postgres: memset vars to 0 to avoid using invalid values inside db_postgres_new_connection() 10 years ago
km_pg_con.h 9e1ff4488a all: updated FSF address in GPL text 11 years ago
km_pg_type.h 9e1ff4488a all: updated FSF address in GPL text 11 years ago
km_res.c 9e1ff4488a all: updated FSF address in GPL text 11 years ago
km_res.h 9e1ff4488a all: updated FSF address in GPL text 11 years ago
km_val.c 9e1ff4488a all: updated FSF address in GPL text 11 years ago
km_val.h 9e1ff4488a all: updated FSF address in GPL text 11 years ago
pg_cmd.c 70ad498b2c db_postgres: remove gcc warnings 10 years ago
pg_cmd.h 34db39d95f db_postgres: fix doxygen errors, small extensions and cleanups in comments 14 years ago
pg_con.c 6619c0d21d db_postgres: add new module vars "timeout" and "tcp_keepalive" 10 years ago
pg_con.h b372a1051e Make the module compile in the sip-router tree. 16 years ago
pg_fld.c 09c7b67bee db_postgres: handle prepare statements in DB APIv2 12 years ago
pg_fld.h 09c7b67bee db_postgres: handle prepare statements in DB APIv2 12 years ago
pg_mod.c 6619c0d21d db_postgres: add new module vars "timeout" and "tcp_keepalive" 10 years ago
pg_mod.h 6619c0d21d db_postgres: add new module vars "timeout" and "tcp_keepalive" 10 years ago
pg_oid.c e2b6d847e0 Remove compiler warning about uninitialized variable. 16 years ago
pg_oid.h 7c1f066c89 - New postgres driver for the new db api in ser 17 years ago
pg_res.c b372a1051e Make the module compile in the sip-router tree. 16 years ago
pg_res.h b372a1051e Make the module compile in the sip-router tree. 16 years ago
pg_sql.c b372a1051e Make the module compile in the sip-router tree. 16 years ago
pg_sql.h b372a1051e Make the module compile in the sip-router tree. 16 years ago
pg_uri.c 480b6d4dfc db_postgres: fixed condition checking the parameter for db uri parsing 11 years ago
pg_uri.h b372a1051e Make the module compile in the sip-router tree. 16 years ago

README

postgres Module

Greg Fausak

August.net

Edited by

Greg Fausak

Copyright © 2003 Greg Fausak
__________________________________________________________________

Table of Contents

1. Admin Guide

1. Overview
2. Dependencies

2.1. Kamailio Modules
2.2. External Libraries or Applications

3. Parameters

3.1. retries (integer)
3.2. timeout (integer)
3.3. tcp_keepalive (integer)

4. Functions

List of Examples

1.1. Set retries parameter
1.2. Set timeout parameter
1.3. Set tcp_keepalive parameter

Chapter 1. Admin Guide

Table of Contents

1. Overview
2. Dependencies

2.1. Kamailio Modules
2.2. External Libraries or Applications

3. Parameters

3.1. retries (integer)
3.2. timeout (integer)
3.3. tcp_keepalive (integer)

4. Functions

1. Overview

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.

2. Dependencies

2.1. Kamailio Modules
2.2. External Libraries or Applications

2.1. Kamailio Modules

The following modules must be loaded before this module:
* No dependencies on other Kamailio modules.

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).

3. Parameters

3.1. retries (integer)
3.2. timeout (integer)
3.3. tcp_keepalive (integer)

3.1. retries (integer)

How many retries to attept to reconnect if connection to Postgres
server becomes broken.

Default value is 2 (that means three attepts to submit the query, first
will triger the connection error and two more (the value of this
parameter) after resetting the connection).

Example 1.1. Set retries parameter
...
modparam("db_postgres", "retries", 3)
...

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)
...

4. Functions

NONE