This document provides instructions for setting up Confluence for use with a PostgreSQL database. Please check the Known Issues for PostgreSQL before you start.

Installing PostgreSQL, Creating a User, and Creating a Database

  1. Download the database software and installed from the PostgreSQLdownload site and save it to your desktop. Choose the package that matches your operating system. Where available, choose the One Click Installer. These instructions assume you will use the One Click Installer. For example:
  2. Start the installer. The illustrations below are from the installation process on a Windows machine.



  3. Choose an Installation Directory.



  4. Choose a Data Directory.



  5. Choose a password.



  6. Select the port.



  7. Choose a Locale.



  8. Click 'Next'.



  9. Wait for the installation to complete.



  10. Skip Stack Builder.



  11. Here's where to start the administration tool.



  12. パスワードを入力します。



  13. Add a new user.



  14. Enter a name and password.



  15. Create a new database.



  16. Assign DB Owner permissions.

Alternatively, If you are on UNIX and do not have the above pgAdmin III administration tool, you can use the command line interface instead. Assuming that you are using the default installation directory of /opt/PostgreSQL/8.3/bin/, enter the following commands:

sudo -s -H -u postgres
# Create the Confluence user:
/opt/PostgreSQL/8.3/bin/createuser -S -d -r -P -E confuser
# Create the Confluence database:
/opt/PostgreSQL/8.3/bin/createdb -O confuser confluence
exit

Setting up Confluence to use the PostgreSQL Database

At this point, you will need to download a JDBC driver from the PostgreSQL website for use with Confluence You'll need the JDBC3 driver if you're using JDK 1.4 / JDK 1.5 and the JDBC4 driver for JDK 1.6.

Windows renames .jar extensions to .zip! Just rename it back to .jar. You'll have to set your folder options to view hidden file extensions if you can't rename it without changing the file type (Tools >> Folder Options >> View >> Uncheck "Hide Extensions for known file types."

If the server that is hosting the PostgreSQL database is not the same server as Confluence, then please ensure that the confluence server can contact the database server and also refer to the PostgreSQL documentation on how to set up pg_hba.conf If the pg_hba.conf file is not set properly, remote communication to the PostgresSQL server will fail.

  1. Download Confluence Standalone, unzip it. (The directory into which you unzipped the Confluence installation is called the Confluence Installation directory. Next you will define the Confluence Home directory.)

  2. Follow Step 4 of the standard installation guide to define your Confluence Home Directory.

  3. Place the JDBC Driver into the <confluence-install-path>/confluence/WEB-INF/lib folder.

  4. Start Confluence and after entering your license code on the 'Confluence Setup Wizard' page, click 'Custom Installation'.



  5. On the 'Choose a Database Configuration' page, select 'PostgreSQL' and click 'External Database'.



  6. Click 'Direct JDBC'.



  7. Enter your PostgreSQL database setup details (defined above) as indicated below.

Running SQL Queries

For ongoing maintenance of your server, you can continue to use PGAdmin as your SQL browser.

トラブルシューティング

If you are unable to connect to the database from Confluence and they are on different machines, most likely you have a firewall in between the two machines or your pg_hba.conf file is misconfigured. Verify that your firewall is set to allow connections through 5432 or double check your hba configuration

If Confluence is complaining that it's missing a class file, you might have forgotten to place the jdbc driver in the WEB-INF/lib folder or possibly have placed it in the wrong folder.

If none of the above describes your issue, please create a support ticket at http://support.atlassian.com and be sure to include your logs (found in confluence-install/logs and confluence-data/logs).