Skip to Content

Postgres Integration

Connect your PostgreSQL database to power Segflow metrics with live data.


Overview

Segflow enables teams to align around data that drives strategic outcomes — not just dashboards. By connecting PostgreSQL, you can import time-series data from your production or analytics database directly into Segflow metrics.

This allows you to analyze how operational and behavioral data influence business KPIs, link them to bets on Flow Boards, and run advanced analyses across your connected system.

postgres


How It Works

Segflow connects securely to your PostgreSQL instance using standard connection credentials. It runs your defined SQL query and expects a consistent two-column output for each metric:

ColumnTypeDescription
dateDATEThe date for each time-series data point
valueFLOAT or INTEGERThe metric value for that date

Segflow stores this data as a time series for use in analysis, forecasting, and Flow Board relationships.

Segflow never modifies your database — it only executes read-only queries defined in your metric configuration.


Setup Instructions

1. Open Integrations in Segflow

In the sidebar, go to Integrations.

2. Add a New Integration

Click “New Integration”, then select Postgres as the source.

3. Enter Database Connection Details

Provide your PostgreSQL credentials:

FieldDescription
HostDomain name or IP address of your PostgreSQL server
PortDatabase port (default is 5432)
DatabaseName of your database
UsernameDatabase user with read permissions
PasswordPassword for the database user

4. Save

Click Save — your PostgreSQL connection will now appear in the integrations list.


Adding Postgres as a Source to a Metric

1. Create or Edit a Metric

Go to the Metrics section and create a new metric (or edit an existing one).

2. Choose Source

Select Postgres as the source type.

3. Write Your Query

Enter a valid SQL query that returns date and value columns. We recommend testing the query directly in Postgres before saving.

4. Save and Run Query

Click Update MetricRun Query to fetch your first dataset.

5. Verify Data

Once the query runs, you’ll see your time-series data visualized in the Overview tab. From there, you can connect the metric to bets or add it to Flow Boards to explore impact relationships.

postgres


Data Refresh

Postgres-based metrics refresh automatically according to your organization’s configured schedule (daily by default). You can also manually refresh any metric from its page to pull the latest data.


Troubleshooting

If your metric doesn’t load data or returns errors:

  • Verify your connection details (host, port, database, username, password).
  • Make sure your PostgreSQL instance allows connections from Segflow’s IP range (if applicable).
  • Ensure your SQL query includes date and value columns.
  • Test your query directly in Postgres to confirm that it runs successfully.
  • Check user permissions — the database user must have read-only access to the tables you’re querying.

Still having issues? Contact Segflow support — we can help validate your connection and query setup.


Next Steps

Last updated on