Skip to content

Configuring PostgreSQL

DROP DATABASE IF EXISTS okmdb;
CREATE USER openkm WITH PASSWORD '*secret*';
CREATE DATABASE okmdb WITH OWNER openkm ENCODING 'UTF8';

Or from the command line.

Terminal window
$ createuser --pwprompt openkm
$ createdb --owner=openkm --encoding=UTF8 okmdb

More info at:

Edit the file $TOMCAT_HOME/openkm.properties

spring.jpa.properties.hibernate.dialect=com.openkm.db.dialect.PostgreSQLDialectspring.jpa.hibernate.ddl-auto=create-only

Edit the file $TOMCAT_HOME/openkm.properties and enable the resource named jdbc/OpenKMDS.

spring.datasource.driver-class-name=org.postgresql.Driver
spring.datasource.url=jdbc:postgresql://localhost:5432/okmdb
spring.datasource.username=openkm
spring.datasource.password=*secret*
spring.datasource.validationQuery=SELECT 1

Edit the file $TOMCAT_HOME/openkm.properties

authentication.openkm.database=true

Go to Administration > Configuration parameters

native.sql.lowercase=true

During OpenKM startup, the application will automatically create an empty database structure.

If you want to obtain the maximum performance from PostgreSQL, pgFouine will help you with this task.

PostgreSQL versions 9.6 and later have changed some tables and columns in the schema. Check that you are using the correct JDBC driver.