Skip to main content

Connecting to the ToMCAT PostgreSQL Database

Overview

This guide provides instructions on how to access the ToMCAT database using either the public API or by directly connecting to the PostgreSQL instance hosted on the Gauss server via pgAdmin.

Access Options

Option 1: Accessing via Public API

You can access the public version of the ToMCAT database through the following API endpoints:

Option 2: Working with a Local SQLite3 Database

You also have the option to download the SQLite3 database locally and work with it directly. Additionally, you can programmatically interact with the PostgreSQL database instance running on Gauss by following the steps outlined below.


Connecting to PostgreSQL Using pgAdmin

Step-by-Step Guide

  1. Clone the ToMCAT Repository To begin, clone the ToMCAT repository and navigate to the /tools directory in the master branch:

    git clone <https://github.com/ml4ai/tomcat.git>
    cd tomcat/tools
    
  2. Set Up Port Forwarding To establish a connection between your local machine and the PostgreSQL database hosted on Gauss, use the port forwarding script:

    ./port_forwarder start gauss 5433
    
  3. Download and Install pgAdmin Download and install pgAdmin by visiting the pgAdmin website. Be sure to download the appropriate version for your operating system.

  4. Register a New Database in pgAdmin After installing pgAdmin, follow these steps to register a new database connection:

    • Open pgAdmin.
    • Right-click on Server in the left panel, click Register, and then select Server.
    • In the registration form, enter the following details:
      • Host name/address: localhost
      • Port: 5433 (the port forwarded from Gauss)
      • Maintenance Database: postgres
      • Username: Your (Gauss) username
      • Password (optional):
    • Click on Save Password.
    • Once the details are entered, click Save.
  5. Verify the Connection After saving, you should now see the databases in the Gauss cluster, including the one entered as the maintenance database. You can now query tables and view their properties using the user-friendly interface provided by pgAdmin.