This topic explains how to configure LabKey Server to retrieve and display data from a PostgreSQL database as an external data source. This topic assumes you have reviewed the general guidance here and provides specific parameters and details for this database type.

Configure the PostgreSQL Data Source

The new external data source must have a unique JNDI name that you will use in naming the properties you will define. In the example on this page, we use "externalPgDataSource", which will appear to users defining external schemas as "externalPg". If you have more than one external PostgreSQL data source, give each a unique name with the DataSource suffix ("firstExternalPgDataSource", "secondExternalPgDataSource", etc.). Learn more here.

In the <LABKEY_HOME>/config/ file, add a new section with the name of the datasource and the parameters you want to define. Provide your own <DB_NAME>, <DB_USERNAME>, and <DB_PASSWORD> where indicated:


There are additional properties you can set, as shown in the template for the main "labkeyDataSource" in the file.


Use this as the driverClassName:



The url property for PostgreSQL takes this form, including the name of the database at the end:



Use "SELECT 1" as the validation query for PostgreSQL. This is the default so does not need to be provided separately for this type of external data source:


Define a New External Schema

To define a new schema from this data source see Set Up an External Schema.

Related Topics

Was this content helpful?

Log in or register an account to provide feedback

expand allcollapse all