# &adminguide;

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

## Dependencies

### &kamailio; Modules

The following modules must be loaded before this module:

- No dependencies on other &kamailio; modules.

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

## Parameters

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

#### Set `retries` parameter

    ...
    modparam("db_postgres", "retries", 3)
    ...

## Functions

NONE