Installation/Custom/PostgreSQL Database

From InfiniteERP Wiki
Jump to: navigation, search

PostgreSQL database

Openbravo supports PostgreSQL as its database engine.

For the specific versions supported and the currently recommended version check the System Requirements.

In general you should never pick a version lower then the recommended ones, but are free to pick higher version if they are supported.

In addition to the PostgreSQL server the the UUID contrib package is required.

PostgreSQL documentation and tutorials are available at:

Required configuration

Required PostgreSQL extensions

Openbravo currently requires two PostgreSQL extensions to be available:

  • uuid-ossp to generate UUID's
  • pg_trgm to have index support for fast contains search

For major versions <10 those are found in the contrib modules which need to be installed additionally. Since version 10 those are part of the normal PostgreSQL server installation.

Config file changes

Openbravo requires a few specific setting done to the main PostgreSQL configuration.

Setting up the numeric locale

The lc_numeric setting should be configured as follows:

<source lang="bash"> lc_numeric = 'en_US.UTF-8' </source>

When running PostgreSQL on windows the equivalent setting is slightly different

<source lang="bash"> lc_numeric = 'English_United States.1252' </source>

Increasing max_locks_per_transaction

The default value 64 of max_locks_per_transaction config setting must be increased to at least 128.

<source lang="bash"> max_locks_per_transaction = 128 </source>

Required user accounts

Openbravo requires access to both a normal non-privileged user account it creates itself during installation as well as the superuser account.

During normal operation only the standard user account is used. However both the installation and update process also requires access to the superuser (to be able to create and update PostgreSQL extensions).

As the normal user account will be created by the Openbravo installation only required setup is to set a password for the superuser account (and configure that later in the Openbravo.properties config file).

Example install on Ubuntu 18.04 LTS

This example outlines the above using on Ubuntu linux.

Install PostgreSQL 10: <source lang="bash"> apt-get install postgresql-10</source>

Create new file /etc/postgresql/10/main/conf.d/00-openbravo-minimum.conf with following content <source lang="bash">lc_numeric = 'en_US.UTF-8' max_locks_per_transaction = 128 </source>

Restart postgres and set superuser passwordvalue) <source lang="bash">pg_ctlcluster 10 main restart

sudo su - postgres -c psql \password <enter password twice> \quit exit </source>

Installing PostgreSQL on Microsoft Windows

Follow the instructions on the PostgreSQL wiki.

On the PostgreSQL download page there is an installer available which also directly includes the UUID extension mentioned as required above.

At the end of using this installer it will ask to optionally launch a 'StackBuilder' program to install more Addon software. None of this its required for Openbravo so that step can be safely skipped.