View Source

{excerpt}PostgreSQL 9.1 installation and configuration{excerpt}
{toc}

h2. Two-phase commit

Nuxeo uses two-phase commit and needs to have the max_prepared_transactions settings updated. In \data\postgresql.conf file change:
{code}
max_prepared_transactions = 64
{code}

Restart server.

h2. Implicit casts

Jena (used for relations and comments) and jBPM (used for workflows) assume some implicit value casting in the SQL they generate.

To make Nuxeo work with PostgreSQL >= 8.3, you must therefore execute the following commands in your PostgreSQL console when connected to the template1 database, so that any database created afterward will come with the required CASTs (if your database is already created, execute the commands in your database as well):
{code}
CREATE FUNCTION pg_catalog.text(integer) RETURNS text STRICT IMMUTABLE LANGUAGE SQL AS 'SELECT textin(int4out($1));';
CREATE CAST (integer AS text) WITH FUNCTION pg_catalog.text(integer) AS IMPLICIT;
COMMENT ON FUNCTION pg_catalog.text(integer) IS 'convert integer to text';

CREATE FUNCTION pg_catalog.text(bigint) RETURNS text STRICT IMMUTABLE LANGUAGE SQL AS 'SELECT textin(int8out($1));';
CREATE CAST (bigint AS text) WITH FUNCTION pg_catalog.text(bigint) AS IMPLICIT;
COMMENT ON FUNCTION pg_catalog.text(bigint) IS 'convert bigint to text';
{code}

h2. Create the role and database for Nuxeo

From the psql command prompt:
{code}
CREATE ROLE nuxeo_user WITH PASSWORD 'nuxeo_pass' LOGIN;
CREATE DATABASE nuxeo_db ENCODING 'UTF8' OWNER nuxeo_user;
{code}