Database Performance Issue on PostgreSQL 7

There is an issue in versions of PostgreSQL prior to 8.0 that causes the database to do a full table scan rather than an index lookup for many of the database queries performed by Confluence. This will cause Confluence to slow significantly the more data it has stored.

Please note that PostgreSQL 7 is no longer supported.

Configuring Database Character Encoding

Refer to Configuring Database Character Encoding.

Incorrect JDBC Driver Used

If you have downloaded and used an incorrect JDBC Driver version, you will see this error when you attempt to setup the Database connection in the Setup Wizard:

2008-04-01 01:45:55,371 ERROR [http-8090-Processor4] [[Standalone].[localhost].[/].[action]] invoke Servlet.service() for servlet action threw exception
java.lang.UnsupportedClassVersionError: Bad version number in .class file
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(Unknown Source)
	at java.security.SecureClassLoader.defineClass(Unknown Source)
	at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1847)
	at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:873)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1326)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1205)
	at java.lang.ClassLoader.loadClassInternal(Unknown Source)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Unknown Source)
	at com.atlassian.confluence.setup.actions.AbstractSetupStandardDatabaseAction.checkDriver(AbstractSetupStandardDatabaseAction.java:20)
	at com.atlassian.confluence.setup.actions.SetupStandardDatabaseAction.execute(SetupStandardDatabaseAction.java:22)
	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:168)

You will need to download the correct JDBC Driver based on your PostgreSQL Database Version and also the JDK you are using. Below is a guide to selecting the correct JDBC version from PostgreSQL's website:

Many other versions of the JDBC driver are available. This includes development versions, compatibility with older JDKs, and previous versions of the driver.

To determine JDK/JVM compatibility this following list matches up versions of the JVM with the JDBC specification implemented.

  • JDK 1.1 - JDBC 1. Note that with the 8.0 release JDBC 1 support has been removed, so look to update your JDK when you update your server.
  • JDK 1.2, 1.3 - JDBC 2.
  • JDK 1.3 + J2EE - JDBC 2 EE. This contains additional support for javax.sql classes.
  • JDK 1.4, 1.5 - JDBC 3. This contains support for SSL and javax.sql, but does not require J2EE as it has been added to the J2SE release.
  • JDK 1.6 - JDBC4. Support for JDBC4 methods is limited. The driver builds, but the majority of new methods are stubbed out.

There is also a matrix on the page which lists all supported versions for the respective PostgreSQL database versions.

Download PostgreSQL JDBC Drivers