View Markdown

PostgreSQL

Connect a PostgreSQL database to WasteNot to pull customer and transaction data directly from your database. Write custom SQL queries to define exactly what data feeds into your audiences.

Prerequisites

  • A PostgreSQL database accessible over the internet
  • A database user with read-only access to the tables you want to query
  • The database host, port, name, and credentials

Connecting PostgreSQL

  1. Add a new PostgreSQL data source

    in WasteNot
  2. Enter a Name
  3. Enter your connection details:
    • Host — The hostname or IP address of your PostgreSQL server
    • Port — The port PostgreSQL is listening on (default: 5432)
    • Database — The name of the database to connect to
    • Username — A read-only database user
    • Password — The password for the database user
  1. Click Connect

WasteNot will verify the connection.

Custom streams

Once connected, you can create streams to define what data WasteNot pulls from your database. Each stream is a SQL query that returns rows matching WasteNot's expected format.

See the Writing Custom Queries guide for full details on required columns and event types.

  1. Go to your PostgreSQL data source detail page
  2. Click New Stream
  3. Give the stream a name, select an event type, and enter your SQL query
  4. Check Enabled and click Save

WasteNot will run enabled streams on a schedule and sync the results automatically.

Frequently asked questions

Was this page helpful?