Configuring PostgreSQL
Database creation
Section titled “Database creation”Create a database and user
Section titled “Create a database and user”DROP DATABASE IF EXISTS okmdb;CREATE USER openkm WITH PASSWORD '*secret*';CREATE DATABASE okmdb WITH OWNER openkm ENCODING 'UTF8';Or from the command line.
$ createuser --pwprompt openkm$ createdb --owner=openkm --encoding=UTF8 okmdbMore info at:
Configure your openkm.properties
Section titled “Configure your openkm.properties”Edit the file $TOMCAT_HOME/openkm.properties
spring.jpa.properties.hibernate.dialect=com.openkm.db.dialect.PostgreSQLDialectspring.jpa.hibernate.ddl-auto=create-onlyConfigure Tomcat datasources
Section titled “Configure Tomcat datasources”Edit the file $TOMCAT_HOME/openkm.properties and enable the resource named jdbc/OpenKMDS.
spring.datasource.driver-class-name=org.postgresql.Driverspring.datasource.url=jdbc:postgresql://localhost:5432/okmdbspring.datasource.username=openkmspring.datasource.password=*secret*spring.datasource.validationQuery=SELECT 1Configure application login
Section titled “Configure application login”Edit the file $TOMCAT_HOME/openkm.properties
authentication.openkm.database=trueEnable native configuration parameter
Section titled “Enable native configuration parameter”Go to Administration > Configuration parameters
native.sql.lowercase=trueRun the application
Section titled “Run the application”During OpenKM startup, the application will automatically create an empty database structure.
Additional information
Section titled “Additional information”If you want to obtain the maximum performance from PostgreSQL, pgFouine will help you with this task.
PostgreSQL 9.6 and later
Section titled “PostgreSQL 9.6 and later”PostgreSQL versions 9.6 and later have changed some tables and columns in the schema. Check that you are using the correct JDBC driver.