All Products
Search
Document Center

DataWorks:PostgreSQL node

Last Updated:Jun 20, 2026

The PostgreSQL node in DataWorks allows you to develop, periodically schedule, and integrate PostgreSQL tasks with other jobs. This topic describes the workflow for developing a PostgreSQL task.

Background information

PostgreSQL is a powerful and flexible open-source relational database management system (RDBMS). It features a robust data model, high scalability and stability, and a rich set of core functionalities. For more information, see PostgreSQL.

Prerequisites

  • The business process has been created.

    Data Studio performs engine-specific development operations based on business flows. Before creating a node, create a business flow first. For more information, see Create a business flow.

  • A PostgreSQL data source is created.

    You must first add your PostgreSQL database as a DataWorks PostgreSQL data source before you can access the data in the database. For more information, see PostgreSQL data source.

    Note

    PostgreSQL nodes support only PostgreSQL data sources that are created with a JDBC connection string.

  • (Optional; required for Resource Access Management (RAM) users) The RAM user used for task development has been added to the target workspace and assigned either the Development or Workspace Administrator role (which grants broad permissions—assign with caution). For more information about adding members and granting permissions, see Add members to a workspace.

Limits

This feature is available in the following regions: China (Hangzhou), China (Shanghai), China (Beijing), China (Shenzhen), China (Chengdu), China (Hong Kong), Singapore, Malaysia (Kuala Lumpur), Germany (Frankfurt), US (Silicon Valley), and US (Virginia).

Step 1: Create PostgreSQL node

  1. Log on to the DataWorks console. In the target region, click Data Development and O&M > Data Development in the left-side navigation pane. Select a workspace from the drop-down list and click Go to Data Development.

  2. Right-click the target workflow and choose Create Node > Database > POSTGRESQL.

  3. In the Create Node dialog box, enter a Name for the node and click OK. Once the node is created, you can develop and configure the task in the node's editor.

Step 2: Develop PostgreSQL task

(Optional) Select PostgreSQL data source

If your workspace has multiple PostgreSQL data sources, select the one you need on the node editor page. If there is only one data source, DataWorks uses it by default.

Note

PostgreSQL nodes support only PostgreSQL data sources that are created with a JDBC connection string.

Develop SQL code: simple example

In the code editor of the PostgreSQL node, write the SQL script for your task. The following example shows how to query information about all base tables in a PostgreSQL database:

SELECT * FROM information_schema.tables
WHERE table_type = 'BASE TABLE';

Develop SQL code: Use scheduling parameters

DataWorks provides Scheduling Parameter to dynamically pass values to your code in scheduled jobs. You can define variables in your task code by using the ${variable_name} format. Then, in the right-side pane of the node editor, go to Scheduling Settings > Scheduling Parameter to assign a value to each variable. For more information about supported formats and configuration, see Formats of scheduling parameters and Configure and use scheduling parameters.

Example: Querying information about all base tables in a database. Set the value of the parameter a to BASE_TABLE.

Sample code:

SELECT * FROM information_schema.tables
WHERE table_type = '${a}';

Step 3: Configure task scheduling

To periodically run the node task, click Scheduling on the right side of the node editing page and configure scheduling settings based on your needs. For more information, see Overview of task scheduling properties.

Note

You must configure the node’s Rerun attribute and Parent Nodes before you can submit the node.

Step 4: Test task code

Perform the following test operations as needed to verify that the task behaves as expected.

  1. (Optional) Select a resource group and assign custom parameter values.

    • Click the 高级运行 icon in the toolbar. In the Parameter dialog box, select the schedule resource group for testing.

    • If your task code uses scheduling parameter variables, assign values to them here for testing. For more information about parameter assignment logic, see Task debugging process.

  2. Save and run the task code.

    Click the 保存 icon in the toolbar to save your task code. Then click the 运行 icon to run the task.

  3. (Optional) Perform smoke testing.

    To run smoke testing in the development environment and verify that the scheduled node task executes as expected, perform smoke testing either during or after node submission. For more information, see Perform smoke testing.

Step 5: Submit and publish the task

After configuring the node task, submit and publish it. Once published, the node runs periodically based on its scheduling configuration.

  1. Click the 保存 icon in the toolbar to save the node.

  2. Click the 提交 icon in the toolbar to submit the node task.

    In the Submission dialog box, enter a Change Description. Optionally, choose whether to require code review after submission.

    Note
    • You must configure the node’s Rerun attribute and Parent Nodes before you can submit the node.

    • Code review helps ensure code quality and prevents errors caused by unreviewed code being published directly to production. If code review is enabled, the submitted node code must be approved by reviewers before it can be published. For more information, see Code review.

If you are using a workspace in standard mode, after successfully submitting the task, click Publish in the upper-right corner of the node editing page to deploy the task to the production environment. For more information, see Publish a task.

Next steps

Task operations: After a task is committed and published, it runs periodically based on the node's configuration. You can click O&M in the top-right corner of the node editing page to go to the Operation Center and view the scheduling and running status of the scheduled task. For more information, see Managing Scheduled Tasks.