Using PostgreSQL 8.3

Using PostgreSQL in general is covered in the standard Nuxeo EP documentation. This FAQ is specific to PostgreSQL version 8.3.

The problems using PostgreSQL 8.3 with Nuxeo EP are due to the fact that PostgreSQL 8.3 is much stricter than PostgreSQL 8.2 with respect to value casting. This is a problem for the Jena library, that is used for relations and comments in Nuxeo EP. This is also a problem for the workflows since Nuxeo 5.1.6.

You may not be able to remove annotations or get errors like:

org.postgresql.util.PSQLException: ERROR: operator does not exist: integer = character varying

com.hp.hpl.jena.db.RDFRDBException: Exception while checking db format - com.hp.hpl.jena.db.RDFRDBException: Internal SQL error in driver - org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block

com.hp.hpl.jena.db.RDFRDBException: Internal SQL error in driver - org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block

To make them work with PostgreSQL 8.3, 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:

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';

If your database is already created, execute these commands in your database as well.

Please see this url for more information. You might also be interested in this migration helper and PostgreSQL settings for Nuxeo DM.

Version 12.1 last modified by Thomas Roger on 13/01/2010 at 18:58

Comments 0

No comments for this document

Attachments 0

No attachments for this document

Creator: Florent Guillaume on 2008/04/07 19:18
© 2008-2010 Nuxeo
1.3.8295