Export to PostgreSQL
The PostgreSQL Data Export feature allows users to export data directly to a PostgreSQL database from the Automated Flow module. Depending on the SELECT permissions on your PostgreSQL server, you either select the schema and table from a dropdown or enter them manually. Afterward, you map your Dengage columns to the columns of the PostgreSQL table.
Before you start, define PostgreSQL as a remote target. See Prerequisite: Defining PostgreSQL as a Remote Target at the end of this page.
Key Terms
- SELECT permission: the database permission to read tables. Dengage uses it to list the schemas and tables of your server.
- Schema: a named group of tables in your database.
- Automated Flow: a flow in Data Space that combines triggers and actions to run data operations automatically. See Automated Flows.
- Data Export node: the action node of an Automated Flow that sends data to a remote target.
- Data Space Update node: the action node of an Automated Flow that writes data into tables in Data Space. It uses the same kind of column mapping.
- Remote Target: an external destination, defined in Settings, that Dengage exports data to. See Remote Targets.
What You Can Export
The Data Export node offers PostgreSQL as a remote target for these data sources:
- Table: an existing table, for example master_contact. After you select the table, Manage Filters lets you add filters and filter groups.
- Segment: an existing segment, from the Segment or Predefined Segments tab.
- SQL Editor: the result of your own SQL query. Write the query on the Source SQL Query screen and click Validate and Preview. You can continue only after the query is validated. A valid query shows the message "This query is valid" and a preview of the result.
- Incremental Logs: transactional and marketing logs. This source works only with a Recurring trigger and the Daily period. With "Occurs every", the minimum interval is 15 minutes. See Exporting Incremental Logs to Databases via Remote Target.
The Permission Change Logs source does not offer PostgreSQL as a remote target.
Note: The maximum export size is 7168 MB.
Accessing the Feature:
- Navigate to Data Space > Data Flow > Automated Flows > Data Export Node:
- From the main menu, go to Data Space > Data Flow > Automated Flows. Click New, select Automated Flow, name the flow and click Next.
- In the flow editor, first add and configure a Recurring Node, then add the Data Export Node and click Configure on it.
- On the Select data source screen, choose the data source and click Next. Select the table or segment, or enter the query, and click Next.
- On the Select Remote Target screen, choose PostgreSQL and one of your PostgreSQL remote targets listed under it.
- PostgreSQL Option in Data Export Node:
- After selecting PostgreSQL, click Next to proceed to the schema/table selection screen.

Select PostgreSQL and one of your remote targets
Step 1: Select Permissions
The next screen, Export Wizard, displays different options depending on whether Dengage has SELECT permissions on your PostgreSQL server:
Scenario 1: SELECT Permissions Exist
- Select Schema and Table:
- Choose the schema from the Select Schema dropdown. Then choose the table you want to export data to from the Table Name dropdown.
- Click Next to proceed to the mapping interface.
Scenario 2: No SELECT Permissions
- Manual Table Entry:
- If Dengage does not have SELECT permissions, Select Schema and Table Name are text fields. Enter the schema name and the table name manually.
- Click Next to continue.
Both fields are required. If you leave them empty, each field shows "The field is required" and a "Please select schema" message appears. The table must already exist in your PostgreSQL database. If Dengage cannot read the table, the mapping screen does not load its columns and a "Something went wrong" message appears.
Step 2: Data Mapping Interface
- Once you select or enter the schema and table, the Column Mapping screen opens.
- This interface mirrors the functionality found in the Data Space Update node, allowing you to map fields between the Dengage platform and the PostgreSQL database.
- Complete the mapping by connecting the relevant Dengage platform fields to the corresponding PostgreSQL table columns.
First, choose the Data Table Action:
- Append: appends all records from the source. This is the default.
- Truncate and Insert: truncates the table and inserts all the records from the source.
Then map the columns. Each row of the Columns table is a column of the PostgreSQL table. In Target Column, choose what Dengage writes into it:
- --Ignore--: the default. The column is not mapped.
- -- Constant Value --: opens an extra field under the dropdown for a fixed value.
- A source column: a column of the data source you selected, for example contact_key.
Click Next.
Step 3: Review the Summary and Export
The Summary step shows the Source, the Target (Target type and Target Name) and the Columns to be exported. Check the details, and use Back to change a setting. Click Export to confirm your setup, and then save the flow.
Check the Export Runs
Go back to Data Space > Data Flow > Automated Flows to follow your flow:
- The Automated Flows tab lists each flow with its Last Run Time, Next Run Time and Update Date.
- The Running Flows tab lists the runs with Started On, Completed On and a status, for example Completed.
- The menu at the end of a row offers View Details, Move, Copy Public ID and Duplicate. Use Duplicate to create a similar export without starting from scratch.
For older runs, see Automated Flows History.
Prerequisite: Defining PostgreSQL as a Remote Target
Before using features requiring PostgreSQL as a remote target, follow these steps to configure it:
- Navigate to Remote Targets:
- Go to Settings > Integrations > Remote Targets.
- Add a New Remote Target:
- Click the Add button.
- Enter Remote Target Details:
- In the pop-up window:
- Fill in the Name of your remote target.
- From the Type dropdown menu, select PostgreSQL.
- Enter the required PostgreSQL credentials for authentication:
- Server: the name or IP address of your PostgreSQL server.
- Port (required): the port number for the connection.
- Db Name: the name of the database on the server.
- User Name (required): the user that Dengage connects with.
- Password (required): the password of that user.
- In the pop-up window:
- Save the Remote Target:
- After entering all the required details, click Save.
Your PostgreSQL remote target is now configured and ready for use in relevant data export features.
Use Cases
- Keep a reporting table up to date: export a Dengage table to your PostgreSQL data warehouse every night with a Recurring trigger and the Truncate and Insert action, so that reports always read the latest data.
- Share a segment with other systems: export the contacts of a segment to a PostgreSQL table that your own applications read.
- Export a custom dataset: use SQL Editor to select only the columns and rows you need before sending them to PostgreSQL.
- Collect message logs: export Incremental Logs, such as email sends and events, to PostgreSQL for your own analysis.
FAQ
Which data can I export to PostgreSQL?
Tables, segments, the result of an SQL Editor query and Incremental Logs. Permission Change Logs do not offer PostgreSQL as a target.
Why do I see text fields and not dropdowns for the schema and table?
Dengage could not list the schemas and tables of your PostgreSQL server, which happens when it has no SELECT permissions. Type the schema name and the table name.
Does Dengage create the PostgreSQL table for me?
No. Enter or select a table that already exists. With a table that Dengage cannot read, the mapping screen does not load and a "Something went wrong" message appears.
PostgreSQL is listed but I cannot select a target. Why?
You have no PostgreSQL remote target yet. Define one under Settings > Integrations > Remote Targets, as described in the Prerequisite section.
How often can the export run?
As often as the Recurring trigger allows: Daily, Weekly, Monthly or Yearly, and within a day either once at a set time or repeatedly at an interval. For Incremental Logs the minimum interval is 15 minutes.
Is there a size limit?
Yes. The maximum export size is 7168 MB.
Where do I see whether the export ran?
In Data Space > Data Flow > Automated Flows. The Automated Flows tab shows the last and next run time of each flow, and the Running Flows tab shows the runs with their status.
Updated 4 days ago