All Products
Search
Document Center

DataWorks:AnalyticDB for PostgreSQL node

Last Updated:May 04, 2026

In DataWorks, you can use an AnalyticDB for PostgreSQL node to develop tasks, schedule them to run periodically, and integrate them with other task types. This topic shows you how to develop a task using an AnalyticDB for PostgreSQL node.

Prerequisites

Background information

An AnalyticDB for PostgreSQL node connects to Alibaba Cloud AnalyticDB for PostgreSQL. For more information, see AnalyticDB for PostgreSQL.

Procedure

  1. On the edit page of the AnalyticDB for PostgreSQL node, follow these steps to develop a task.

    Develop SQL code

    In the SQL editor, write your task code. You can define variables in the code by using the ${variable_name} format. You can then assign values to these variables in the Scheduling Parameters section of the Scheduling Settings pane on the right. This lets you dynamically pass parameters to your code during scheduled runs. For more information about scheduling parameters, see Scheduling parameter sources and expressions. For example:

    CREATE TABLE employees (
        id INT PRIMARY KEY,
        name VARCHAR(100),
        age INT,
        department VARCHAR(50)
    );
    INSERT INTO employees (id, name, age, ${var}) VALUES
    (1, 'Alice', 30, 'HR'),
    (2, 'Bob', 25, 'Engineering'),
    (3, 'Charlie', 35, 'Marketing');
    
    Note
    • In the example, you can set the ${var} parameter to the department field.

    • The code editor for the AnalyticDB for PostgreSQL node supports standard PostgreSQL syntax. For more information, see SQL syntax.

    Run the SQL task

    1. In the Debug Configuration section, configure Compute Resource and Resource Group.

      1. For Computing resource, select the name of the AnalyticDB for PostgreSQL computing resource that you registered on DataWorks.

      2. For Resource Group, select a resource group for scheduling that has passed the connectivity test with the computing resource. For more information, see Network Connectivity Solutions.

    2. Click the Select a data source drop-down list on the toolbar. In the dialog box, select the AnalyticDB for PostgreSQL computing resource you created, and then click Run to run the SQL task.

  2. To run the node task periodically, configure its scheduling properties. For details, see Configure scheduling properties.

  3. After the node task configuration is complete, you must deploy the node. For more information, see Node/Workflow Deployment.

  4. After deployment, you can view the status of periodic tasks in Operation Center. For more information, see Get started with Operation Center.