Create a real-time dataset through PostgreSQL

更新时间: 2026-06-17 14:07:31

You can parse PostgreSQL data source table fields in SQL mode to define dataset metrics. This topic describes how to create and configure a real-time dataset by using PostgreSQL.

Prerequisites

  • Before you create a real-time dataset, make sure that the tag project to which the dataset belongs is created. For more information, see .

  • A PostgreSQL data source is created for the real-time dataset. For more information, see .

Procedure

  1. On the Dataphin home page, in the top menu bar, click Tag -> Tag Workbench.

  2. Open the Add Real-time Dataset dialog box:

    Select Tag Project -> click Real-time Dataset -> click Add Dataset.

    image

  3. In the Add Real-time Dataset dialog box, select PostgreSQL Dataset.

  4. On the Add PostgreSQL page, configure the basic information for the dataset.

    Parameter

    Description

    Dataset Name

    The name of the dataset. The name can contain Chinese characters, English letters, digits, and underscores (_), and can be up to 64 characters in length.

    Dataset Code

    A unique identifier for the real-time dataset, used to distinguish datasets that have the same name. The code must start with a letter and can contain lowercase letters, digits, and underscores (_), up to 64 characters in length.

    Owner

    The owner of the real-time dataset.

    Description

    A brief description of the real-time dataset, up to 1,000 characters in length.

  5. Set up the Processing Logic for the real-time dataset.

    Parameter

    Description

    Data Source

    The PostgreSQL data source to use for processing.

    Processing Logic (SQL)

    After you select the data source, enter the SQL processing logic.

    • The SQL SELECT statement must include a field that serves as the input parameter for the real-time tag query service.

    • The SQL statement must include a variable as the primary key, in the format of ${parameter}.

    • Example:

      SELECT pk, indicatorA, indicatorB FROM source_table where pk = ${parameter}

    Metric Configuration

    After you select the data source and enter the SQL processing logic, click Metric Parsing to configure the primary key or metric display name, value type, and description based on the parsed field names. Supported value types: string, long integer, double-precision floating-point number, date, Boolean, decimal.

    To add more metrics, click + Add.

  6. Click Publish.

    Note

    After the dataset is saved, click Authenticate to enter parameter values based on your processing logic and verify that the logic works as expected.

What to do next

After you create and publish the real-time dataset, you can create corresponding real-time tags. For more information, see .

上一篇: Create real-time datasets through Hologres 下一篇: Manage offline datasets
阿里云首页 智能数据建设与治理 Dataphin 相关技术圈