Skip to main content

PostgreSQL Connection

Connect your PostgreSQL database to give SignalPilot access to schemas, tables, and data for AI-powered analysis.
What you’ll need: Database host, port, credentials, and network access from your SignalPilot environment.

Quick Setup

1

Open Database Connections

In SignalPilot, click Database icon in the sidebar → Add Connection → Select PostgreSQL
2

Enter connection details

Choose your preferred method:
  • Configuration form (recommended for beginners)
  • Connection URL (faster if you have the full string)
3

Test and save

Click Test Connection to verify, then Create Connection
SignalPilot will validate credentials and discover your database schema.

Connection Methods

Fill in these fields:
FieldDescriptionExample
Connection NameFriendly label for referenceProduction DB, Analytics
HostServer addresslocalhost or mydb.abc123.us-east-1.rds.amazonaws.com
PortDefault: 54325432
DatabaseDatabase nameanalytics
UsernamePostgreSQL userdb_user
PasswordUser password••••••••
Description (optional)Notes about this connectionProduction analytics warehouse
Credentials are encrypted locally using AES-256 before storage.

Finding Your Connection Details

  1. Go to RDS ConsoleDatabases
  2. Click your PostgreSQL instance
  3. Find Endpoint (this is your host) and Port
  4. Database name is in Configuration tab
  5. Username/password were set during RDS creation
Example endpoint: mydb.abc123.us-east-1.rds.amazonaws.com
Host: localhost or 127.0.0.1Port: 5432 (default)Database: Check with:
psql -l  # List all databases
Username: Your PostgreSQL user (often postgres by default)
  1. Go to your Heroku app → ResourcesHeroku Postgres
  2. Click SettingsView Credentials
  3. Copy the URI (this is your connection URL)
Or use individual fields: Host, Database, User, Password, Port
  1. Go to Cloud SQL → Select your instance
  2. Overview tab shows connection name
  3. Click Connect to this instance for details
  4. Use Public IP as host (or set up Cloud SQL Proxy)
Note: You may need to whitelist SignalPilot’s IP or use Cloud SQL Proxy for secure connections.

What SignalPilot Can Do

Once connected, the AI agent can:

Inspect Schema

View tables, columns, data types, and relationships automatically

Query Data

Generate and execute SQL queries based on your requests

Understand Context

Use schema information to provide accurate suggestions

Join Tables

Automatically infer relationships between tables for complex queries
Example interaction:
You: "Show me total revenue by region for Q4 2024"

Agent: [Inspects schema, finds revenue_data table with region and date columns]
        [Generates SQL query with appropriate filters]
        [Executes query and loads results into dataframe]

Security Best Practices

Never commit database credentials to git or share them in notebooks. SignalPilot stores encrypted credentials locally.
Create a dedicated PostgreSQL user with SELECT permissions only:
CREATE USER signalpilot_readonly WITH PASSWORD 'secure_password';
GRANT CONNECT ON DATABASE analytics TO signalpilot_readonly;
GRANT USAGE ON SCHEMA public TO signalpilot_readonly;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO signalpilot_readonly;
This prevents accidental data modifications through SignalPilot.
  • Use IP whitelisting in your firewall/security group
  • Enable SSL/TLS connections (add ?sslmode=require to connection URL)
  • Consider VPN or SSH tunneling for extra security
  • Production: Read-only access, restricted tables
  • Staging: Read-write if needed
  • Development: Broader access to test environments
Avoid using production credentials in development notebooks.

Troubleshooting

Causes:
  • Firewall blocking connection
  • Incorrect host/port
  • Database not running
Solutions:
  • Verify host and port are correct
  • Check firewall rules allow connections from SignalPilot
  • Confirm database is running: pg_isready -h <host> -p <port>
Causes:
  • Wrong username or password
  • User doesn’t have access to specified database
Solutions:
  • Double-check credentials (watch for trailing spaces)
  • Verify user has CONNECT permission: GRANT CONNECT ON DATABASE <db> TO <user>
  • Check pg_hba.conf allows connections from your IP
For self-signed certificates: Add ?sslmode=require to connection URL (not verify-full)For proper SSL: Ensure your PostgreSQL server has valid SSL certificates configured
Solutions:
  • List available databases: psql -h <host> -U <user> -l
  • Create the database if needed: CREATE DATABASE analytics;
  • Check spelling of database name (case-sensitive)

Next Steps