All Products
Search
Document Center

DataWorks:AnalyticDB for PostgreSQL node

Last Updated:Jul 07, 2025

DataWorks provides AnalyticDB for PostgreSQL nodes that you can use to develop and periodically schedule AnalyticDB for PostgreSQL tasks and integrate the tasks with other types of tasks. This topic describes how to use an AnalyticDB for PostgreSQL node to develop tasks.

Prerequisites

Background information

AnalyticDB for PostgreSQL nodes are used to connect to Alibaba Cloud AnalyticDB for PostgreSQL. For more information, see AnalyticDB for PostgreSQL.

Procedure

  1. On the configuration tab of the AnalyticDB for PostgreSQL node, perform the following operations to develop a task:

    Develop SQL code

    In the code editor, develop task code. You can define variables in the ${Variable name} format in the task code, and configure scheduling parameters in the Scheduling Parameters section of the Properties tab in the right-side navigation pane of the node configuration tab to assign the scheduling parameters to the variables as values. This way, the values of the scheduling parameters are dynamically replaced in the node code when the node is scheduled to run. Sample code:

    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 sample code, you can set ${var} to the department field.

    • In the code editor of the AnalyticDB for PostgreSQL node, write SQL statements based on the syntax supported by AnalyticDB for PostgreSQL. For more information, see SQL syntax.

    Run the task

    1. On the Debugging Configurations tab, configure the Computing Resource and Resource Group parameters.

      1. Select the name of the AnalyticDB for PostgreSQL computing resource that you registered in DataWorks from the Computing Resource drop-down list.

      2. Select a resource group for scheduling that is connected to the computing resource from the Resource Group drop-down list. For more information, see Network connectivity solutions.

    2. In the upper part of the code editor, click the Select DataSource drop-down list. In the pop-up, select the created AnalyticDB for PostgreSQL computing resource and click Run in the top toolbar.

  2. If you want to run the node on a regular basis, configure the scheduling information based on your business requirements.

  3. After the node is configured, deploy the node. For more information, see Deploy nodes.

  4. After you deploy the node, view the running status of the node in Operation Center. For more information, see Getting started with Operation Center.