Skip to content

Postgres

Postgres Node

There are multiple methods to connect to Postgres. Below is an example of provisioning a Postgres instance with the pgvector extension, which you can then connect to from the Postgres node.

Create a file named docker-compose.yml with the content below:

# Run this command to start the database:
# docker-compose up --build
version: "3"
services:
  db:
    hostname: 127.0.0.1
    image: pgvector/pgvector:pg16
    ports:
      - 5432:5432
    restart: always
    environment:
      - POSTGRES_DB=api
      - POSTGRES_USER=myuser
      - POSTGRES_PASSWORD=ChangeMe
    volumes:
      - ./init.sql:/docker-entrypoint-initdb.d/init.sql

docker compose up to start the Postgres container.

Create new credential with the configured user and password:

Fill in the node's field with values configured in docker-compose.yml. For example:

  • Host: localhost
  • Database: api
  • Port: 5432

Voila! You have now successfully setup Postgres Vector ready to be used.

Troubleshooting

If the Postgres node cannot reach your database, check that the Host value is reachable from the platform (use a public host or IP rather than localhost).