Skip to main content
PostgreSQL connector
Ori Sagi avatar
Written by Ori Sagi
Updated over 4 months ago

Pecan uses an industry-standard PostgreSQL JDBC Driver to connect to and import data from your PostgreSQL database. These processes will happen automatically and only require Pecan to have read access to your database.

The relevant steps are described below. If you need help with them, be sure to consult with your internal IT or DevOps team.

To use Pecan’s PostgreSQL connector, your PostgreSQL version should be 11 or higher. If you have an older version please reach out to our support team.

Prerequisite steps

  1. First, make sure you whitelist these Pecan IP addresses:

    54.246.108.184
    54.216.8.168
    54.73.234.235

2. Next, create a user for Pecan on your PostgreSQL server by using the CREATE USER SQL command. This will provide Pecan with read access to the tables that will be used to build your model(s).

If you’re not sure which tables will be needed, you can simply provide read access to all tables. You’ll be able to decide which tables to import later when you import your data to Pecan.

How to configure a PostgreSQL connection in Pecan

  1. Log in to Pecan, select the “Connections” tab, and click Add connection.

  2. Select “PostgreSQL” and complete the following fields:

    • Connection name – This is how you’ll identify the connection when creating and working with models on the platform.

      • Names should be unique, reflecting the data source and what’s stored in it.

      • Valid characters include letters, numbers, and underscores (e.g. “paid_downloads_fall_2021”).

      • Note that connection names can’t be changed once created.

    • Connection type – Select "Read" if the connection will be used to import data into Pecan. Select "Write" if it will be used to export predictions from Pecan to PostgreSQL.

    • Server – This is the address of your database (e.g. my_db.eu-west-1.postgresql.amazonaws.com, 96.127.44.11).

    • Port – This is the IP address of your server and connection port. The default port for PostgreSQL instances is 5432.

    • Database – This is the name of the database Pecan should use.

      • Servers can hold many databases. If you want to access data from multiple databases that sit on the same server, you’ll need to create a new Pecan connection for each database.

    • Username and Password – You will have created these on your PostgreSQL server during Step 2 of the prerequisite steps (above).

    • Use SSL - mark this checkbox if your organization uses SSL encryption for PostgreSQL.

  3. Now, click Test connection to make sure everything is working correctly. Then click Create connection to complete the setup. (For more information, see Testing and creating a data connection.)

Did this answer your question?