Skip to main content
Connect your PostgreSQL database to AstroBee to analyze your application data, user records, transactions, and more. Get queryable access to all your PostgreSQL tables and schemas.
Experimental feature: PostgreSQL connector is currently in beta. We’re actively improving sync reliability and adding more features.

Prerequisites

  • A PostgreSQL database (version 9.4 or later)
  • Database access credentials (host, port, database name, username, password)
  • Network access from Fivetran’s IP addresses to your database
  • One of the following update methods enabled:
    • XMIN (recommended): Simple change tracking using PostgreSQL’s transaction ID system
    • WAL (Write-Ahead Log): More advanced change data capture
    • Teleport: Direct query-based replication
Your database must be accessible from Fivetran’s IP addresses. If your PostgreSQL database is behind a firewall, you’ll need to allowlist Fivetran’s IPs. See the Fivetran PostgreSQL setup guide for the current IP list.

Connecting PostgreSQL

1

Navigate to Sources

From the Sources page, click on “PostgreSQL” in the Available Sources section
Sources page showing PostgreSQL connector
2

Start connection

Click “Connect” to begin the setup process
Configure PostgreSQL interface
3

Authorize with Fivetran

AstroBee uses Fivetran to securely connect to PostgreSQL. Click “Continue” to proceed
Fivetran authorization screen
Fivetran ensures:
  • Secure: Data transfer is encrypted end-to-end using TLS/SSL
  • Private: Your credentials are encrypted and never exposed
4

Configure connection settings

Follow the setup guide on the right for detailed configuration instructions from Fivetran.
PostgreSQL connection configuration
Configure your PostgreSQL connection with the following details:Basic connection information:
  • Host: Your PostgreSQL server hostname or IP address
  • Port: Database port (default: 5432)
  • Database: Name of the database to connect to
  • User: PostgreSQL username with read access
  • Password: Database user password
Update method: Choose how Fivetran tracks changes
  • XMIN (recommended for most cases): Uses PostgreSQL’s transaction ID system
  • WAL with pg_output: More efficient for high-volume changes
  • Teleport: Direct query-based replication
SSH tunnel (optional): If your database requires SSH tunnel access
  • Enable SSH tunnel option
  • Provide SSH host, port, and authentication details
Follow the Fivetran PostgreSQL setup guide for detailed configuration steps, including:
  • How to create a read-only database user for Fivetran
  • Configuring WAL settings for change data capture
  • Setting up SSH tunnels and network access
  • SSL/TLS certificate requirements
Click “Save & Test” to verify the connection
5

Select tables to sync

Back in AstroBee, your database schema is being analyzed. This typically takes 10 seconds to 10 minutes depending on your database size.Once the schema is loaded, select which tables to include in your analysis. Your PostgreSQL database may include tables like:
  • users: User account information
  • orders: Transaction and order records
  • products: Product catalog data
  • events: Application event logs
  • sessions: User session tracking
  • Custom application tables specific to your database
Select PostgreSQL tables in AstroBee
Click “Save” to complete the setup
6

Connection complete

Your PostgreSQL connection is now active and appears in “My Sources”
PostgreSQL connection completed

What happens next

After connecting PostgreSQL, you can create a data layer to start querying your database. Click “Create Data Layer” to let AstroBee analyze your PostgreSQL tables and generate a business model for natural language queries.

Syncing data

PostgreSQL connections use manual sync - you control when data is refreshed. To sync your latest database data:
  1. Navigate to the Sources page
  2. Find your PostgreSQL connection
  3. Click the “Sync now” button
AstroBee will pull the latest records from your PostgreSQL database based on the configured update method.

Understanding PostgreSQL data

PostgreSQL syncs table data along with schema information:
  • Table structure: Column names, data types, primary keys, and foreign keys
  • Row data: Actual records from selected tables
  • Relationships: Detected relationships between tables based on foreign key constraints
  • Change tracking: Incremental updates based on your chosen update method (XMIN, WAL, or Teleport)
The exact tables and columns available depend on your database schema and which tables you selected during setup.

Troubleshooting

For additional help, see Fivetran’s PostgreSQL troubleshooting guide.
Issue: Unable to connect to PostgreSQL database.Solution:
  • Verify your database host, port, and credentials are correct
  • Ensure your database is running and accessible
  • Check that Fivetran’s IP addresses are allowlisted in your firewall
  • Confirm network connectivity between Fivetran and your database
  • Test your credentials with a local PostgreSQL client first
  • Verify SSL/TLS requirements if your database requires encrypted connections
Issue: Connection fails with authentication error.Solution:
  • Verify your PostgreSQL username and password are correct
  • Ensure the user has SELECT permissions on the tables you want to sync
  • Check that the user has access to the specified database
  • Confirm the user account is active and not locked
  • For WAL-based sync, ensure the user has REPLICATION permissions
  • Review PostgreSQL’s pg_hba.conf to ensure the connection method is allowed
Issue: Connection succeeds but no tables are available to select.Solution:
  • Verify the database user has permissions to view table schemas
  • Check that the database has tables in the public schema or specified schemas
  • Ensure the user has SELECT permission on information_schema tables
  • Confirm you’re connecting to the correct database
  • Look for tables in non-public schemas (may require additional permissions)
Issue: Initial sync fails or incremental syncs don’t capture changes.Solution:
  • Check database logs for connection errors or permission issues
  • For XMIN: Verify tables have xmin column tracking enabled
  • For WAL: Ensure wal_level is set to ‘logical’ and max_replication_slots is sufficient
  • Verify the database user still has valid credentials
  • Check for long-running transactions that may block replication
  • Trigger a manual re-sync to refresh the connection
  • Contact support@astrobee.ai if issues persist after checking permissions
Issue: Syncing takes longer than expected or impacts database performance.Solution:
  • Large databases with millions of rows can take hours for initial sync
  • Consider syncing only necessary tables to reduce load
  • Schedule syncs during off-peak hours to minimize impact
  • For WAL-based sync, monitor replication lag in PostgreSQL
  • Check database CPU and memory usage during sync
  • Consider creating indexes on timestamp columns used for change tracking
  • Use XMIN update method for better performance on smaller databases
Issue: Cannot connect when using SSH tunnel.Solution:
  • Verify SSH host, port, and credentials are correct
  • Ensure the SSH user has permission to create tunnels
  • Check that the SSH server is running and accessible
  • Confirm the database is reachable from the SSH server
  • Test SSH connection manually before configuring in Fivetran
  • Review SSH server logs for authentication or connection errors

Next steps