Skip to main content
PostgreSQL

Connect Avenue to your PostgreSQL Database

Updated over a week ago

Obtaining your PostgreSQL credentials

Your PostgreSQL credentials are needed for Avenue to connect to your PostgreSQL database.

Definitions

  • Database Name: The name of the specific database within the PostgreSQL server that you are trying to access.

  • Host: The IP address or hostname of the server where your PostgreSQL is running.

  • Username: The username you (or your database admin) set up when PostgreSQL was installed.

  • Password: The password for the above user.

  • Port: The port where PostgreSQL is running. The default is 5432.

  • Connection String: A single string that combines the above information for easy access.

How to Procure Credentials

  1. Identifying an Existing Database Name: If the database already exists and you're attempting to find the name, you can retrieve the list of databases in PostgreSQL by using the following command in the PostgreSQL interactive terminal (psql):

    1. Switch to the postgres user (or another user with similar superuser privileges):

      sudo -u postgres psql
    2. List all databases:

      \l

  2. Identify the Host: This is usually the IP address or hostname of the server where your PostgreSQL is running.

  3. Determine the Username: This is the username that was set up when PostgreSQL was installed. The default superuser for Postgres is usually postgres.

  4. Determine the Password: This is the password for the above user. If you've forgotten the password, it will need to be reset by a user with superuser privileges.

  5. Identify the Port: The default port for PostgreSQL is 5432. However, this may have been changed during setup or if running multiple instances of PostgreSQL.

Using a Connection String

The connection string combines all the previous information into a single string. The structure for a PostgreSQL connection string is:

postgresql://username:password@localhost:5432/mydatabase

Replace username, password, localhost, 5432, and mydatabase with your actual credentials and database name.


Adding PostgreSQL as Datasource

💡Please allow Avenue to connect to your database by allow-listing our IP addresses: 3.217.246.91, 52.55.137.145

  1. Select Data Sources and click + Add New Connection.

  2. There are two options to add PostgreSQL as a datasource: Manual Input or by using a Connection String.

    1. When adding them manually you will input the credentials previously collected into their related fields

    2. If using a Connection String is preferred simply enter the string into the

  3. Once your credentials are added select Connect Database


Connecting a monitor to your PostgreSQL data

Once you have connected your PostgreSQL instance you can use it in your monitors by heading to the Select the Data section of the monitor create or edit form and select it from the database dropdown.

Did this answer your question?